Пример #1
0
        // ======== On Switched To ========= //

        public override void OnSwitchedTo()
        {
            MainTabbedPage.OnAnySwitchedTo(this);
            MainTabbedPage.theModelEntryPage.SyncNoisePicker(noisePicker);
            if (!Exec.IsExecuting() &&                                          // we could be waiting on a continuation! StartAction would switch us right back to this page even if it does not start a thread!
                currentModelInfo != MainTabbedPage.theModelEntryPage.modelInfo) // forkWorker: we can compute the chart concurrently
            {
                MainTabbedPage.theModelEntryPage.StartAction(forkWorker: true, switchToChart: false, switchToOutput: false, autoContinue: false);
            }
            KChartHandler.ChartUpdate(null);
        }
Пример #2
0
 public override void OnSwitchedTo()
 {
     MainTabbedPage.OnAnySwitchedTo(this);
     if (currentModelInfo != MainTabbedPage.theModelEntryPage.modelInfo)
     {
         OutputClear();
         MainTabbedPage.theModelEntryPage.StartAction(forkWorker: true, switchToChart: false, switchToOutput: false, autoContinue: true);
     }
     else
     {
         currentOutputAction.action();
     }
 }
Пример #3
0
        public ModelListPage()
        {
            Title           = "My Networks";
            IconImageSource = "icons8openedfolder96.png";

            // in iOS>Resource the images of the TitleBar buttons must be size 40, otherwise they will scale but still take the horizontal space of the original

            listView = new ListView {
                Margin = 20,
            };
            listView.ItemTemplate = new DataTemplate(typeof(MyModelListCell));                   // use MyModelListCell here to activate context menus on (ModelInfo) list items
            listView.ItemTemplate.SetBinding(MyModelListCell.TextProperty, "title");             // binds property in ModelInfo
            listView.ItemTemplate.SetBinding(MyModelListCell.DetailProperty, "datestring");      // binds property in ModelInfo

            listView.ItemSelected += async(object sender, SelectedItemChangedEventArgs e) => {
                if (e.SelectedItem != null)
                {
                    MainTabbedPage.theModelEntryPage.SetModel(e.SelectedItem as ModelInfo, editable: true);
                    MainTabbedPage.SwitchToTab(MainTabbedPage.theModelEntryPageNavigation);
                }
                listView.SelectedItem = null;                      // Deselect item.
            };
            listView.BackgroundColor = MainTabbedPage.almostWhite; // BACKGROUND COLOR OF MENU ITEMS

            ToolbarItems.Add(
                new ToolbarItem("Add", "icons8plus32.png",
                                async() => {
                MainTabbedPage.theModelEntryPage.SetModel(new ModelInfo(sample), editable: true);
                MainTabbedPage.SwitchToTab(MainTabbedPage.theModelEntryPageNavigation);
            }));

            AbsoluteLayout layout = new AbsoluteLayout();

            AbsoluteLayout.SetLayoutBounds(listView, new Rectangle(0, 0, 1, 1));
            AbsoluteLayout.SetLayoutFlags(listView, AbsoluteLayoutFlags.All);

            layout.Children.Add(listView);
            Content = layout;
        }
Пример #4
0
 public override void OnSwitchedTo()
 {
     MainTabbedPage.OnAnySwitchedTo(this);
     listView.ItemsSource = docs;
 }
Пример #5
0
 public override void OnSwitchedTo()
 {
     MainTabbedPage.OnAnySwitchedTo(this);
     SetTitle(this.title);
     Gui.gui.GraphUpdate();
 }
Пример #6
0
        //private static Dictionary<string, Dictionary<string, bool>> visibilityCache =
        //    new Dictionary<string, Dictionary<string, bool>>();

        //public Dictionary<string,bool> Visibility() {
        //    string theModel = modelInfo.title;
        //    lock (visibilityCache) { if (!visibilityCache.ContainsKey(theModel)) visibilityCache[theModel] = new Dictionary<string, bool>(); }
        //    return visibilityCache[theModel];
        //}

        public override void OnSwitchedTo()
        {
            MainTabbedPage.OnAnySwitchedTo(this);
            SyncNoisePicker(noisePicker);
        }
Пример #7
0
 public override void OnSwitchedTo()
 {
     MainTabbedPage.OnAnySwitchedTo(this);
     RegenerateList();
 }