internal static CanvasProperty ShowWindowDialog()
        {
            var tpWin = new TemplatePickerWindow();

            tpWin.ShowDialog();
            return(tpWin.Value);
        }
        private void TemplateButton_Click(object sender, RoutedEventArgs e)
        {
            var canvas = TemplatePickerWindow.ShowWindowDialog();

            if (canvas == null)
            {
                return;
            }
            var type     = typeof(CanvasProperty);
            var propInfo = type.GetProperties();
            var numProps = propInfo.GetLength(0) - (typeof(UserControl)).GetProperties().GetLength(0);

            for (var j = 0; j < numProps; j++)
            {
                propInfo[j].SetValue(this, propInfo[j].GetValue(canvas, null), null);
            }
            var w = GSApp.main.windowsMgr.activeWindow;

            if (w is graphWindow)
            {
                ((graphWindow)w).AdoptWindowWideCanvasProperties();
            }
            else if (w is ruleWindow)
            {
                ((ruleWindow)w).AdoptWindowWideCanvasProperties();
            }
            Update();
        }
        public void NewGraph_ClickOnExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            var canvas = TemplatePickerWindow.ShowWindowDialog();

            if (canvas == null)
            {
                canvas = new CanvasProperty();
            }
            var gW = new graphWindow(canvas);

            windowsMgr.AddandShowWindow(gW);
        }
 public void NewGrammarRule_ClickOnExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     try
     {
         ///
         /// a temporary fix until we phase out UI.UICanvas
         var canvas = TemplatePickerWindow.ShowWindowDialog();
         if (canvas == null)
         {
             canvas = new CanvasProperty();
         }
         var rW = new ruleWindow(canvas);
         windowsMgr.AddandShowWindow(rW);
     }
     catch (Exception exc)
     {
         ErrorLogger.Catch(exc);
     }
 }