private void ExecuteShowWindowCommand()
        {
            var vm = new DataGridButtonSubViewModel();

            vm.ItemName = CurrentRowItem.ItemName;
            vm.Quantity = CurrentRowItem.Quantity;
            WindowDisplayService.ShowDialog("SubWindowKey", vm);
        }
Exemple #2
0
 private void ExecuteShowDialogCommand(object x)
 {
     //  XAMLで指定した子ViewのリソースのKeyと、子ViewModelのオブジェクトを渡す
     //  ちなみに、関係するXAMLの部分:
     //  <Window.Resources>
     //        <mvvm:RegisterWindow x:Key="ChildWindowKey" Type="local:WindowDisplayServiceChildView" />
     //  </Window.Resources>
     WindowDisplayService.ShowDialog("ChildWindowKey", new WindowDisplayServiceChildViewModel());
 }
        private void ExecuteLoginCommand(object x)
        {
            var passwordBox = x as System.Windows.Controls.PasswordBox;

            //  Passwordプロパティを推奨されていないけど、SecurePasswordプロパティはいろいろと手間なので、今回は使う
            var identity  = new GenericIdentity(passwordBox.Password);
            var principal = new GenericPrincipal(identity, GetRoles(passwordBox.Password));

            Thread.CurrentPrincipal = principal;

            WindowDisplayService.ShowDialog("LoggedinViewKey", new LoggedinViewModel());
        }
        private void ExecuteLoginCommand(object x)
        {
            //  ComboBoxの確認のためのコードなので、このへんは本来不要
            var cb = x as System.Windows.Controls.ComboBox;
            var v1 = cb.SelectedValue;  //  直接入力するとSelectedValue/SelectedItemには値が入ってこない
            var v2 = cb.SelectedItem;   //  同上
            var v3 = cb.Text;           //  Textには入ってくる
            var v4 = UserName;          //  データバインディングしているプロパティにも同じ値が入ってくる

            var identity  = new GenericIdentity(UserName);
            var principal = new GenericPrincipal(identity, GetRoles(UserName));

            Thread.CurrentPrincipal = principal;

            WindowDisplayService.ShowDialog("LoggedinViewKey", new LoggedinViewModel());
        }
Exemple #5
0
        private void ExecuteOpenCommand()
        {
            // WindowsFormウィンドウを開く
            // WindowsFormを直接Show()できないので、
            // WPFのView(WindowsFormView)のWindowsFormsHostの中にWindowsFormを貼付
            //var f = new WindowsFormView();
            //f.Show();

            WindowDisplayService.Show("WindowsForm", new WindowsFormViewModel());


            // WPFウィンドウを開く
            WindowDisplayService.Show("WPF", new WPFProject.MainViewModel());


            // クラスライブラリのメソッドを使ってメッセージボックスを表示
            MessageBoxService.ShowInformation(DllProject.Class1.Say());
        }
 private void ExecuteShippingCommand(object x)
 {
     WindowDisplayService.ShowDialog("Shiping", new ShipingViewModel());
 }
 private void ExecuteReceivingCommand(object x)
 {
     WindowDisplayService.ShowDialog("Receiving", new ReceivingViewModel());
 }
 private void ExecuteOpenCommand(object x)
 {
     WindowDisplayService.ShowDialog("NextView", new DynamicStringFormatViewModel());
 }