示例#1
0
        /// <summary>
        /// Build a WPF control to use as the template for the given key view model
        /// </summary>
        /// <param name="keyViewModel">The key view model.</param>
        /// <returns></returns>
        public object BuildControlForKey(Models.BaseOnScreenKeyViewModel keyViewModel)
        {
            var textBlock = new TextBlock();

            textBlock.SetBinding(TextBlock.TextProperty, new Binding("Display"));
            return(textBlock);
        }
 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;
 }
 /// <summary>
 /// Build the control that is to be used for the given key view model
 /// </summary>
 /// <param name="keyViewModel">The key view model.</param>
 /// <returns></returns>
 public object BuildContentControlForKey(BaseOnScreenKeyViewModel keyViewModel)
 {
     return OnScreenKeyControlBuilder.BuildControlForKey(keyViewModel);
 }