Esempio n. 1
0
 public static void Executing(bool executing)
 {
     if (executing)
     {
         theOutputPageNavigation.IconImageSource = "icons8refresh96.png"; // this is actually a size 40 icon in iOS resources: otherwise it does not scale
         theChartPageNavigation.IconImageSource  = "icons8refresh96.png"; // this is actually a size 40 icon in iOS resources: otherwise it does not scale
         // we need to use size 40x40 icons or they get stuck at wrong size after changing icon:
         theModelEntryPage.deviceButton.Source = "icons8device40disabled.png";
         theChartPage.deviceButton.Source      = "icons8device40disabled.png";
         theModelEntryPage.startButton.Source  = "icons8play40disabled.png";
         theChartPage.startButton.Source       = "icons8play40disabled.png";
         theChartPage.stopButton.Source        = "icons8stop40.png";
     }
     else
     {
         theOutputPageNavigation.IconImageSource = "icons8truefalse100.png";
         theChartPageNavigation.IconImageSource  = "icons8combochart48.png"; // DO NOT use icons8combochart96, it will not scale
         // we need to use size 40x40 icons or they get stuck at wrong size after changing icon:
         theModelEntryPage.deviceButton.Source = KDeviceHandler.Exists() ? "icons8device40on.png" : "icons8device40off.png";
         theChartPage.deviceButton.Source      = KDeviceHandler.Exists() ? "icons8device40on.png" : "icons8device40off.png";
         theModelEntryPage.startButton.Source  = "icons8play40.png";
         theChartPage.startButton.Source       = "icons8play40.png";
         theChartPage.stopButton.Source        = "icons8stop40disabled.png";
     }
 }
Esempio n. 2
0
        public ImageButton DeviceButton()
        {
            ImageButton button = new ImageButton()
            {
                Source            = "icons8device40off.png",
                HeightRequest     = MainTabbedPage.buttonHeightRequest,
                WidthRequest      = MainTabbedPage.buttonHeightRequest,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                BackgroundColor   = MainTabbedPage.secondBarColor,
            };

            button.Clicked += async(object sender, EventArgs e) => {
                if (!modelInfo.executable)
                {
                    return;
                }
                if (Exec.IsExecuting())
                {
                    return;                     // pretend button is in disabled state
                }
                if (KDeviceHandler.Exists())
                {
                    deviceButton.Source = "icons8device40off.png";
                    MainTabbedPage.theChartPage.deviceButton.Source = "icons8device40off.png";
                    MainTabbedPage.theChartPage.SwitchToPlotView();
                    KDeviceHandler.Stop();
                }
                else
                {
                    KDeviceHandler.Start(35, 200);
                    MainTabbedPage.theChartPage.SwitchToDeviceView();
                    deviceButton.Source = "icons8device40on.png";
                    MainTabbedPage.theChartPage.deviceButton.Source = "icons8device40on.png";
                }
            };
            return(button);
        }