/// <summary>
        /// Fired the the object is ready, setup the scroll detection.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EndDetectingListView_Loaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
        {
            // Stop listening to the event. We only want to do this once.
            Loaded -= EndDetectingListView_Loaded;

            // Get the scroll bars
            List <DependencyObject> scrollBars = new List <DependencyObject>();

            UiControlHelpers <ScrollBar> .RecursivelyFindElement(this, ref scrollBars);

            // Find the scrollbar we want. Fun fact. Since in the scollviewer (which is in the list) the scrollContentPresenter is before the
            // main scrollbars we will find scrollbars of the header before ours. Ours should always be the last scrollbars in the list.
            // SO KEEP GOING DON'T BREAK until we find the last vertical scrollbar.
            foreach (DependencyObject dObject in scrollBars)
            {
                if (((ScrollBar)dObject).Orientation == Orientation.Vertical)
                {
                    m_listeningScrollBar = (ScrollBar)dObject;
                }
            }

            // Make sure we found it
            if (m_listeningScrollBar == null)
            {
                throw new Exception("Failed to find the scroll bar!");
            }

            // Add the listener
            m_listeningScrollBar.ValueChanged += ScrollBar_ValueChanged;
        }
Example #2
0
        private void chart_Loaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
        {
            ChartAdornmentInfo adornmentInfo = new ChartAdornmentInfo();

            adornmentInfo.SymbolTemplate = grid.Resources["adornment"] as DataTemplate;
            series.AdornmentsInfo        = adornmentInfo;
        }
Example #3
0
        private void chart_Loaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
        {
            ChartAdornmentInfo adornmentInfo = new ChartAdornmentInfo();

            adornmentInfo.Symbol     = ChartSymbol.Ellipse;
            adornmentInfo.ShowMarker = true;
            series.AdornmentsInfo    = adornmentInfo;
        }
Example #4
0
        private void trackBall_Loaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
        {
            DataTemplate       adornmentTemplate = trackBall.Resources["adornmentTemplate"] as DataTemplate;
            ChartAdornmentInfo cai = new ChartAdornmentInfo();

            cai.ShowLabel     = true;
            cai.LabelTemplate = adornmentTemplate;
            splineAreaSeries.AdornmentsInfo = cai;
        }
Example #5
0
        private void crossHair_Loaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
        {
            ChartAdornmentInfo chartAdornmentInfo1 = new ChartAdornmentInfo();

            chartAdornmentInfo1.Background         = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
            chartAdornmentInfo1.ShowLabel          = true;
            chartAdornmentInfo1.AdornmentsPosition = AdornmentsPosition.TopAndBottom;

            columnSeries.AdornmentsInfo = chartAdornmentInfo1;
        }
Example #6
0
        private void MainPage_Loaded1(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
        {
            Loaded -= MainPage_Loaded1;

            var loggerFactory = LoggerFactory.Create((builder) => _ = builder.AddDebug().SetMinimumLevel(LogLevel.Trace));

            var filterDeviceDefinitions = new List <FilterDeviceDefinition> {
                new FilterDeviceDefinition(vendorId: 16701, productId: 8455, usagePage: 65280)
            };

            var deviceDataStreamer =
                filterDeviceDefinitions
#if WINDOWS_UWP
                .CreateUwpHidDeviceFactory(loggerFactory)
#else
                .CreateAndroidUsbDeviceFactory(UsbManager, AppContext, loggerFactory, writeBufferSize: 8, readBufferSize: 8)
#endif
                .CreateDeviceDataStreamer(async(device) =>
            {
                string display = null;

                try
                {
                    //Note this needs an extra 0 at the start for UWP
                    var data = await device.WriteAndReadAsync(new byte[8] {
                        0x01, 0x80, 0x33, 0x01, 0x00, 0x00, 0x00, 0x00
                    });

                    //Note this data will have an extra 0 at the start on UWP
                    var temperatureTimesOneHundred = (data.Data[3] & 0xFF) + (data.Data[2] << 8);

                    var temperatureCelsius = Math.Round(temperatureTimesOneHundred / 100.0m, 2, MidpointRounding.ToEven);

                    display = temperatureCelsius.ToString() + "°C";
                }
                catch
                {
                    display = "Bad read";
                }

                if (display == null)
                {
                    return;
                }

                _ = DispatchingExtensions.RunOnDispatcher(() => TheTextBlock.Text = display);
            }
                                          //Note this breaks UWP
                                          , async(d) =>
            {
                await d.InitializeAsync();
            }
                                          ).Start();
        }
Example #7
0
        private void waterMark_Loaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
        {
            DataTemplate       labelTemplate1      = MainGrid.Resources["adornmentTemplate"] as DataTemplate;
            ChartAdornmentInfo chartAdornmentInfo1 = new ChartAdornmentInfo();

            chartAdornmentInfo1.Symbol        = ChartSymbol.Ellipse;
            chartAdornmentInfo1.ShowLabel     = true;
            chartAdornmentInfo1.LabelTemplate = labelTemplate1;

            lineSeries.AdornmentsInfo = chartAdornmentInfo1;
        }
 private void HomeButton_Click(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
 {
     if (this.AppFrame.CurrentSourcePageType == typeof(LandingPage))
     {
         this.RootSplitView.IsPaneOpen = false;
     }
     else
     {
         this.AppFrame.Navigate(typeof(LandingPage), null);
     }
 }
Example #9
0
        private void crossHair_Loaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
        {
            DataTemplate       labelTemplate1      = MainGrid.Resources["labeltemplate"] as DataTemplate;
            ChartAdornmentInfo chartAdornmentInfo1 = new ChartAdornmentInfo();

            chartAdornmentInfo1.ShowLabel           = true;
            chartAdornmentInfo1.AdornmentsPosition  = AdornmentsPosition.TopAndBottom;
            chartAdornmentInfo1.SegmentLabelContent = LabelContent.YValue;
            chartAdornmentInfo1.LabelTemplate       = labelTemplate1;

            columnSeries.AdornmentsInfo = chartAdornmentInfo1;
        }
        private void chart_Loaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
        {
            ChartAdornmentInfo chartAdornmentInfo1 = new ChartAdornmentInfo();
            ChartAdornmentInfo chartAdornmentInfo2 = new ChartAdornmentInfo();

            chartAdornmentInfo1.ShowLabel          = true;
            chartAdornmentInfo1.AdornmentsPosition = AdornmentsPosition.TopAndBottom;

            chartAdornmentInfo2.ShowLabel          = true;
            chartAdornmentInfo2.AdornmentsPosition = AdornmentsPosition.TopAndBottom;

            column.AdornmentsInfo  = chartAdornmentInfo1;
            column1.AdornmentsInfo = chartAdornmentInfo2;
        }
Example #11
0
        private void visualData_Loaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
        {
            DataTemplate       labelTemplate = MainGrid.Resources["adornmentTemplate"] as DataTemplate;
            ChartAdornmentInfo cai           = new ChartAdornmentInfo();
            ChartAdornmentInfo cai1          = new ChartAdornmentInfo();

            cai.ShowLabel           = true;
            cai.SegmentLabelContent = LabelContent.LabelContentPath;
            cai.AdornmentsPosition  = AdornmentsPosition.TopAndBottom;
            cai.LabelTemplate       = labelTemplate;
            cai1.Symbol             = ChartSymbol.Ellipse;

            columnSeries.AdornmentsInfo = cai;
            lineSeries.AdornmentsInfo   = cai1;
        }
Example #12
0
        private void Accumulation_charts_Loaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
        {
            DataTemplate       labelTemplate      = MainGrid.Resources["labelTemplate"] as DataTemplate;
            ChartAdornmentInfo chartAdornmentInfo = new ChartAdornmentInfo();

            chartAdornmentInfo.AdornmentsPosition  = AdornmentsPosition.Bottom;
            chartAdornmentInfo.ShowConnectorLine   = true;
            chartAdornmentInfo.UseSeriesPalette    = true;
            chartAdornmentInfo.ShowLabel           = true;
            chartAdornmentInfo.ConnectorHeight     = 80;
            chartAdornmentInfo.SegmentLabelContent = LabelContent.LabelContentPath;
            chartAdornmentInfo.LabelTemplate       = labelTemplate;
            chartAdornmentInfo.HorizontalAlignment = HorizontalAlignment.Center;
            chartAdornmentInfo.VerticalAlignment   = VerticalAlignment.Center;
            pieSeries.AdornmentsInfo = chartAdornmentInfo;
        }
        private async void CreatePlaylist(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(PlaylistTitle.Text))
            {
                await new MessageDialog("Please enter a playlist name.", "Playlist Creation Error").ShowAsync();
                return;
            }

            try
            {
                await BasePlaylist.CreatePlaylistAsync(_serviceType, PlaylistTitle.Text, IsPrivate.IsOn);

                Hide();
            }
            catch (Exception ex)
            {
                await new MessageDialog("Could not create playlist. Please try again later.\nReason: " + ex.Message, "Playlist Creation Error").ShowAsync();
            }
        }
        private void chart_Loaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
        {
            DataTemplate labelTemplate1 = MainGrid.Resources["labeltemplate"] as DataTemplate;
            DataTemplate labelTemplate2 = MainGrid.Resources["labeltemplate"] as DataTemplate;

            ChartAdornmentInfo chartAdornmentInfo1 = new ChartAdornmentInfo();
            ChartAdornmentInfo chartAdornmentInfo2 = new ChartAdornmentInfo();

            chartAdornmentInfo1.ShowLabel          = true;
            chartAdornmentInfo1.AdornmentsPosition = AdornmentsPosition.TopAndBottom;
            chartAdornmentInfo1.LabelTemplate      = labelTemplate1;

            chartAdornmentInfo2.ShowLabel          = true;
            chartAdornmentInfo2.AdornmentsPosition = AdornmentsPosition.TopAndBottom;
            chartAdornmentInfo2.LabelTemplate      = labelTemplate2;

            column.AdornmentsInfo  = chartAdornmentInfo1;
            column1.AdornmentsInfo = chartAdornmentInfo2;
        }
Example #15
0
        private void zoomPan_Loaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
        {
            ChartZoomPanBehavior zoomBehavior = new ChartZoomPanBehavior();

            zoomBehavior.EnablePanning        = true;
            zoomBehavior.ZoomMode             = UI.Xaml.Charts.ZoomMode.XY;
            zoomBehavior.HorizontalPosition   = HorizontalAlignment.Right;
            zoomBehavior.EnableZoomingToolBar = true;
            zoomBehavior.ToolBarBackground    = new SolidColorBrush(Colors.LightGray);
            zoomPan.Behaviors.Add(zoomBehavior);

            if (AnalyticsInfo.VersionInfo.DeviceFamily != "Windows.Mobile")
            {
                zoomBehavior.EnableSelectionZooming = true;
            }
            else
            {
                zoomBehavior.EnableSelectionZooming = false;
            }
        }
Example #16
0
        /// <summary>
        /// Get's called after SelectionWidget was loaded and updates the Widgets Selection Dropdown.
        /// </summary>
        private void SelectionWidget_Loaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
        {
            selectionMappings = new System.Collections.Generic.List <SelectionMapping>();
            if (Widget?.Item.CommandDescription?.CommandOptions?.Count > 0)
            {
                foreach (OpenHABCommandOptions option in Widget.Item.CommandDescription.CommandOptions)
                {
                    SelectionMapping mapping = new SelectionMapping(option.Command, option.Label);
                    selectionMappings.Add(mapping);
                }
            }

            if (Widget?.Mappings.Count > 0)
            {
                foreach (OpenHABWidgetMapping option in Widget.Mappings)
                {
                    SelectionMapping mapping = new SelectionMapping(option.Command, option.Label);
                    selectionMappings.Add(mapping);
                }
            }

            SelectionComboBox.ItemsSource = selectionMappings;
            SetState();
        }
Example #17
0
 // Register when the frame is loaded. So the name of the frame is available!
 private void RegionFrame_Loaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
 {
     Shell.Regions.Add(this);
 }
Example #18
0
 private void ClosePanel_Click(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
 {
     RootSplitView.IsPaneOpen = false;
 }
Example #19
0
 /// <summary>
 /// Called when the view is unloaded.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
 public void OnViewLoadStateUnloaded(object sender, LoadedEventArgs e)
 {
     OnUnloaded();
 }
Example #20
0
 private void HelpButton_Click(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
 {
 }
Example #21
0
 private void MainPageUnloaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
 {
     this.scope.Dispose();
 }
Example #22
0
 private void PopupControl_Unloaded(
     object sender,
     global::Windows.UI.Xaml.RoutedEventArgs e)
 {
     Window.Current.SizeChanged -= Window_SizeChanged;
 }
Example #23
0
 /// <summary>
 /// Called when the view is unloaded.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
 public void OnViewLoadStateUnloaded(object sender, LoadedEventArgs e)
 {
     OnUnloaded();
 }
 private void SelectionWidget_Loaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
 {
     SetState();
 }
Example #25
0
 /// <summary>
 /// Called when the page is unloaded.
 /// </summary>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected virtual void OnUnloaded(UIEventArgs e)
 {
 }
 private void MediaElementMediaEnded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
 {
     this.playCount--;
     this.tcsPlaying.TrySetResult(true);
 }
Example #27
0
 /// <summary>
 /// Called when the user control is unloaded.
 /// </summary>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected virtual void OnUnloaded(UIEventArgs e)
 {
 }
 private void SettingsViewUnloaded(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
 {
     this.scope.Dispose();
 }
Example #29
0
 internal void Click_BaseArgs_handler(global::System.Object param0, global::Windows.UI.Xaml.RoutedEventArgs param1)
 {
     this.dataRoot.Click_BaseArgs(param0, param1);
 }