Exemple #1
0
        public MainWindow()
        {
            InitializeComponent();
            this.Closing += MainWindow_Closing;

            MyMember = new Member();
            MyNews   = new NewsFeeder();
            MyMember.TryAuthorization += Button_EnterToPersonalSpace_Click;
            if (MyMember.CanLoadFromFile(@"bin/storage.bin"))
            {
                MyMember = MyMember.LoadFromFile(@"bin/storage.bin");
                InitializeNewsFeed();
                TextBox_Login.Text            = MyMember.Person.Login;
                PasswordBox_Password.Password = MyMember.Person.Password;
            }

            //Grid_Menu.MouseEnter += (s, e) =>
            //{
            //    Grid_Menu.BeginAnimation(OpacityProperty,
            //        new DoubleAnimation(Grid_Menu.Opacity, 1, TimeSpan.FromSeconds(0.5)));
            //    Grid_Menu.BeginAnimation(MarginProperty,
            //        new ThicknessAnimation(Grid_Menu.Margin, new Thickness(0, 50, 0, 0), TimeSpan.FromSeconds(0.5)));
            //};
            //Grid_Menu.Opacity = 0;
            //Grid_Menu.MouseLeave += (s, e) =>
            //{
            //    Grid_Menu.BeginAnimation(OpacityProperty,
            //        new DoubleAnimation(Grid_Menu.Opacity, 0, TimeSpan.FromSeconds(0.5)));
            //    Grid_Menu.BeginAnimation(MarginProperty,
            //        new ThicknessAnimation(Grid_Menu.Margin, new Thickness(-131, 50, 0, 0), TimeSpan.FromSeconds(0.5)));
            //};
        }
Exemple #2
0
 private void Button_PostNews_Click(object sender, RoutedEventArgs e)
 {
     NewsFeeder.PostNews(new NewsNode(TextBox_NewsName.Text,
                                      TextBox_NewsContent.Text,
                                      TextBox_NewsAuthor.Text,
                                      DateTime.Now.ToShortDateString(),
                                      TextBox_ImgSource.Text));
 }