Inheritance: BlockControl
Beispiel #1
0
        public override FieldControl GenerateUIElement(bool isForEditing)
        {
            TextBlockControl control = new TextBlockControl();

            control.Initialize(this);
            return(control);
        }
Beispiel #2
0
    public void Save()
    {
        var blockControls =
            _flow.Controls.Cast <BlockControl>()
            .Where(x => x is TextBlockControl || x is QueryBlockControl)
            .ToList();

        PageNotebookItemRecord pageRecord = new() { Name = ItemName, Blocks = new() };

        foreach (var control in blockControls)
        {
            PageBlockRecord blockRecord =
                control switch {
                TextBlockControl textBlock => textBlock.SaveToRecord(),
                QueryBlockControl queryBlock => queryBlock.SaveToRecord(),
                     _ => throw new NotImplementedException()
            };
            pageRecord.Blocks.Add(blockRecord);
        }

        _manager.SetItemData(ItemName, pageRecord);
    }
Beispiel #3
0
        private void InitializeControls()
        {
            MainWindowSettings = new MainWindowSettings
            {
                Height = MAIN_WINDOW_HEIGHT_SMALL,
            };

            ShowProgramsListButton = new ButtonControl
            {
                ForegroundColor = ControlsColors.BLACK,
                Text            = "Programs",
                IsVisible       = true,
                Command         = new RelayCommand(ShowProgramsListButtonCommand)
            };

            MainMessage = new TextBlockControl
            {
                ForegroundColor = ControlsColors.BLACK,
                Text            = "Welcome in Programs Starter!",
                IsVisible       = true
            };

            CancelButton = new ButtonControl
            {
                ForegroundColor = ControlsColors.BLACK,
                Text            = "Cancel",
                IsVisible       = false,
                Command         = new RelayCommand(CancelButtonCommand)
            };

            SaveButton = new ButtonControl
            {
                ForegroundColor = ControlsColors.BLACK,
                Text            = "Save",
                IsVisible       = true,
                Command         = new RelayCommand(SaveButtonCommand)
            };

            StartNowButton = new ButtonControl
            {
                ForegroundColor = ControlsColors.BLACK,
                Text            = "Start Now",
                IsVisible       = true,
                Command         = new RelayCommand(StartNowButtonCommand)
            };

            DontStartButton = new ButtonControl
            {
                ForegroundColor = ControlsColors.BLACK,
                Text            = "Don't start",
                IsVisible       = true,
                Command         = new RelayCommand(DontStartButtonCommand)
            };

            StatusProgressBar = new ProgressBarControl
            {
                IsVisible = true,
                Value     = 0,
                Text      = "Waiting...",
            };

            AboutText           = new TextBlockControl();
            AboutText.IsVisible = true;
            AboutText.Text      = "v. 0.0.1.0  KR @ 2019";

            ProgramsToStart           = new ProgramsToStartDataGridWrapper();
            ProgramsToStart.IsVisible = false;
        }