Interaction logic for DefaultKeyTemplate.xaml
Inheritance: System.Windows.Controls.UserControl
 public object BuildControlForKey(BaseOnScreenKeyViewModel keyViewModel)
 {
     var virtualKeyViewModel = keyViewModel as VirtualKey;
     if (virtualKeyViewModel != null)
     {
         if (virtualKeyViewModel.Key == VirtualKeyCode.LWIN || virtualKeyViewModel.Key == VirtualKeyCode.RWIN)
         {
             return new WindowsKeyTemplate()
             {
                 DataContext = keyViewModel
             };
         }
     }
     var template = new DefaultKeyTemplate
     {
         DataContext = keyViewModel
     };
     return template;
 }
Ejemplo n.º 2
0
        public object BuildControlForKey(BaseOnScreenKeyViewModel keyViewModel)
        {
            var virtualKeyViewModel = keyViewModel as VirtualKey;

            if (virtualKeyViewModel != null)
            {
                if (virtualKeyViewModel.Key == VirtualKeyCode.LWIN || virtualKeyViewModel.Key == VirtualKeyCode.RWIN)
                {
                    return(new WindowsKeyTemplate()
                    {
                        DataContext = keyViewModel
                    });
                }
            }
            var template = new DefaultKeyTemplate
            {
                DataContext = keyViewModel
            };

            return(template);
        }