public ShipAttackView()
        {
            XamlReader.Load(this);
            FireControlList.BindDataContext(c => c.DataStore, (DictionaryVM <object, string> m) => m.DisplayList);
            FireControlList.SelectedIndexBinding.BindDataContext((DictionaryVM <object, string> m) => m.SelectedIndex);

            AttackTargetList.BindDataContext(c => c.DataStore, (DictionaryVM <object, string> m) => m.DisplayList);
            AttackTargetList.SelectedIndexBinding.BindDataContext((DictionaryVM <object, string> m) => m.SelectedIndex);
        }
示例#2
0
        public ShipMoveView()
        {
            XamlReader.Load(this);
            TargetDropDown.BindDataContext(c => c.DataStore, (DictionaryVM <object, string> m) => m.DisplayList);
            TargetDropDown.SelectedIndexBinding.BindDataContext((DictionaryVM <object, string> m) => m.SelectedIndex);

            OrdersPossible.BindDataContext(c => c.DataStore, (DictionaryVM <object, string> m) => m.DisplayList);
            OrdersPossible.SelectedIndexBinding.BindDataContext((DictionaryVM <object, string> m) => m.SelectedIndex);

            OrderList.BindDataContext(c => c.DataStore, (DictionaryVM <object, string> m) => m.DisplayList);
            OrderList.SelectedIndexBinding.BindDataContext((DictionaryVM <object, string> m) => m.SelectedIndex);
        }
示例#3
0
#pragma warning restore CS0649

        public ChatModule()
        {
            XamlReader.Load(this);

            data = new ObservableCollection <TextObj> {
                new TextObj("Hellox"), new TextObj("Theres")
            };

            chatBox.BindDataContext(c => c.DataStore, (MyModel m) => m.ListItems);

            DataContext = new MyModel {
                ListItems = data
            };
        }
    private void twoD_LayerUISetup()
    {
        rB_OLRX     = new RadioButton[CentralProperties.maxLayersForMC];
        rB_OLRY_exp = new RadioButton[CentralProperties.maxLayersForMC];

        rB_COLX = new RadioButton[CentralProperties.maxLayersForMC];
        rB_COLY = new RadioButton[CentralProperties.maxLayersForMC];

        rB_CCDU  = new RadioButton[CentralProperties.maxLayersForMC];
        rB_CTCDU = new RadioButton[CentralProperties.maxLayersForMC];

        cB_OLRX_Av       = new CheckBox[CentralProperties.maxLayersForMC];
        cB_layer_OLRY_Av = new CheckBox[CentralProperties.maxLayersForMC];

        rB_CLWR  = new RadioButton[CentralProperties.maxLayersForMC];
        rB_CLWR2 = new RadioButton[CentralProperties.maxLayersForMC];

        xOLRBs_enabledState = new List <bool[]>();
        yOLRBs_enabledState = new List <bool[]>();

        xCOLRBs_enabledState = new List <bool[]>();
        yCOLRBs_enabledState = new List <bool[]>();

        SCDURBs_enabledState = new List <bool[]>();
        TCDURBs_enabledState = new List <bool[]>();

        CLWRRBs_enabledState  = new List <bool[]>();
        CLWR2RBs_enabledState = new List <bool[]>();

        for (int i = 0; i < CentralProperties.maxLayersForMC; i++)
        {
            xOLRBs_enabledState.Add(new bool[CentralProperties.maxLayersForMC]);
            yOLRBs_enabledState.Add(new bool[CentralProperties.maxLayersForMC]);

            xCOLRBs_enabledState.Add(new bool[CentralProperties.maxLayersForMC]);
            yCOLRBs_enabledState.Add(new bool[CentralProperties.maxLayersForMC]);

            SCDURBs_enabledState.Add(new bool[CentralProperties.maxLayersForMC]);
            TCDURBs_enabledState.Add(new bool[CentralProperties.maxLayersForMC]);

            CLWRRBs_enabledState.Add(new bool[CentralProperties.maxLayersForMC]);
            CLWR2RBs_enabledState.Add(new bool[CentralProperties.maxLayersForMC]);
        }

        experiment_table      = new TableLayout();
        tabPage_2D_experiment = new TabPage {
            Text = "Experiment", Content = experiment_table
        };

        tabControl_2D_simsettings.Pages.Add(tabPage_2D_experiment);

        TableRow row0 = new();

        experiment_table.Rows.Add(row0);

        Panel p = new();

        row0.Cells.Add(new TableCell {
            Control = p
        });

        listBox_layers = new ListBox {
            Width = 55, DataContext = DataContext, ContextMenu = listbox_menu
        };
        listBox_layers.BindDataContext(c => c.DataStore, (UIStringLists m) => m.layerNames);
        listBox_layers.SelectedIndexChanged += listbox_change;

        Scrollable scrollable_twoDLayer = new();

        tabPage_2D_layer_table       = new TableLayout();
        scrollable_twoDLayer.Content = tabPage_2D_layer_table;

        Splitter sp = new()
        {
            Orientation = Orientation.Horizontal,
            FixedPanel  = SplitterFixedPanel.Panel1,
            Panel1      = listBox_layers,
            Panel2      = scrollable_twoDLayer
        };

        p.Content = sp;

        twoD_LayerUISetup_exp();
    }