Esempio n. 1
0
        private void registerMessenger()
        {
            //Send Selected Row For Edit
            Messenger.Default.Register <UserModel>(this, "MyNavigationService",// doNavigate);
                                                   (fe) =>
            {
                if (fe == null)
                {
                    fe = new UserModel();
                }
                var addWindow = new NewMembership(fe);
                addWindow.ShowDialog();
            });

            //Get Search String From Search Form
            Messenger.Default.Register <string>(this, "MySearchNavigationService",// getmsg);
                                                (message) =>
            {
                if (!string.IsNullOrEmpty(message))
                {
                    //  Name.Text = message;
                }
            });

            //Get Datas After Insert
            Messenger.Default.Register <ObservableCollection <UserModel> >(this, "InsertedService",// getmsg);
                                                                           (message) =>
            {
                userData.AllUser = message;
            });
        }
Esempio n. 2
0
        private void New_Click(object sender, RoutedEventArgs e)
        {
            var new_win = new NewMembership(new UserModel());

            new_win.Show();

            this.Close();
        }
Esempio n. 3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button b = (sender) as Button;

            if (b.CommandParameter != null)
            {
                UserModel ppp       = user.GetUserById(int.Parse(b.CommandParameter.ToString()));
                var       addWindow = new NewMembership(ppp);
                //addWindow.ShowDialog();

                addWindow.Show();
                this.Close();
            }
        }