Example #1
0
        // A ViewManager queries its child LayoutChoice_Set and puts the result into its parent View as needed.
        // That is, the ViewManager is what triggers the querying of layouts in the first place.
        public ViewManager(ContentView parentView, LayoutChoice_Set childLayout, VisualDefaults layoutDefaults)
        {
            this.visualDefaults = layoutDefaults;
            this.callerHolder.AddParent(this);
            this.SetLayout(childLayout);

            this.mainView = new ManageableView(this);
            this.SetParent(parentView);
        }
Example #2
0
        private LayoutChoice_Set makeDemoLayout(VisualDefaults defaults)
        {
            Button okButton = new Button();

            okButton.Clicked += OkButton_Clicked;
            this.defaultsByButton[okButton] = defaults;

            return(new ButtonLayout(okButton, defaults.DisplayName));
        }
Example #3
0
        private void OkButton_Clicked(object sender, EventArgs e)
        {
            Button         button         = sender as Button;
            VisualDefaults layoutDefaults = this.defaultsByButton[button];

            if (this.Chose_VisualDefaults != null)
            {
                this.Chose_VisualDefaults.Invoke(layoutDefaults);
            }
        }
Example #4
0
 public OverrideLayoutDefaults_Layout(VisualDefaults defaultsOverride)
 {
     this.defaultsOverride = defaultsOverride;
 }
Example #5
0
        public VisualDefaults Build()
        {
            ViewDefaults viewDefaults = new ViewDefaults();

            viewDefaults.ApplicationBackground = this.applicationBackground;

            TextBlock_ViewDefaults textblockDefaults = new TextBlock_ViewDefaults();

            textblockDefaults.TextColor       = this.uneditableTextColor;
            textblockDefaults.BackgroundColor = this.uneditableTextBackgroundColor;
            viewDefaults.TextBlock_Defaults   = textblockDefaults;

            TextBox_ViewDefaults textboxDefaults = new TextBox_ViewDefaults();

            textboxDefaults.TextColor       = this.uneditableTextBackgroundColor;
            textboxDefaults.BackgroundColor = this.uneditableTextColor;
            viewDefaults.TextBox_Defaults   = textboxDefaults;

            ButtonViewDefaults buttonDefaults = new ButtonViewDefaults();

            buttonDefaults.TextColor       = this.uneditableTextColor;
            buttonDefaults.BackgroundColor = this.uneditableTextBackgroundColor;
            if (this.buttonInnerBevelColor != null)
            {
                buttonDefaults.InnerBevelColor = this.buttonInnerBevelColor.Value;
            }
            else
            {
                buttonDefaults.InnerBevelColor = Color.DarkGray;
            }
            if (this.buttonOuterBevelColor != null)
            {
                buttonDefaults.OuterBevelColor = this.buttonOuterBevelColor.Value;
            }
            else
            {
                buttonDefaults.OuterBevelColor = Color.LightGray;
            }
            viewDefaults.ButtonWithBevel_Defaults = buttonDefaults;

            ButtonViewDefaults buttonWithoutBevelDefaults = new ButtonViewDefaults();

            buttonWithoutBevelDefaults.TextColor       = this.uneditableTextBackgroundColor;
            buttonWithoutBevelDefaults.BackgroundColor = this.uneditableTextColor;
            viewDefaults.ButtonWithoutBevel_Defaults   = buttonWithoutBevelDefaults;

            LayoutDefaults layoutDefaults = new LayoutDefaults();

            TextBox_LayoutDefaults textbox_layoutDefaults = new TextBox_LayoutDefaults();

            textbox_layoutDefaults.Font                = new ScaledFont();
            textbox_layoutDefaults.Font.Name           = this.fontName;
            textbox_layoutDefaults.Font.SizeMultiplier = this.fontSizeMultiplier;
            layoutDefaults.TextBox_Defaults            = textbox_layoutDefaults;

            VisualDefaults visualDefaults = new VisualDefaults();

            visualDefaults.LayoutDefaults = layoutDefaults;
            visualDefaults.ViewDefaults   = viewDefaults;

            visualDefaults.PersistedName = this.displayName;
            visualDefaults.DisplayName   = this.displayName;

            return(visualDefaults);
        }