Ejemplo n.º 1
0
 public AlignPattern(AlignPattern rhs)
     : base(rhs)
 {
     Offset   = rhs.Offset;
     MinWidth = rhs.MinWidth;
     Comment  = rhs.Comment;
 }
Ejemplo n.º 2
0
        // Notes:
        //  - This editor UI is mainly a wrapper for 'PatternEditor' with an added TextBox
        //    for the comment text. When the editor is closed, use 'Editor.Pattern' to update
        //    the AlignPattern in the group.

        public PatternEditorUI(UIElement owner, AlignPattern pattern)
        {
            InitializeComponent();
            Owner  = Window.GetWindow(owner);
            Editor = Gui_.FindVisualChild <PatternEditor>((DependencyObject)Content) ?? throw new Exception("Expected a pattern editor child control");
            Editor.EditPattern(pattern, clone: false);

            Cancel      = Command.Create(this, CancelInternal);
            Accept      = Command.Create(this, AcceptInternal);
            DataContext = this;
        }