Beispiel #1
0
        private void NavigateToSample(object sender, SelectionChangedEventArgs e)
        {
            GridView       gridView = sender as GridView;
            SampleMetadata sample   = gridView.SelectedItem as SampleMetadata;

            // Only navigate if the selected page isn't currently loaded.
            if (!Type.Equals(MainWindow.mainFrame.CurrentSourcePageType, typeof(SampleBasePage)))
            {
                MainWindow.mainFrame.Navigate(typeof(SampleBasePage), sample);
            }
        }
Beispiel #2
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            var allSamples = await SampleMetadata.GetAllSampleMetadata();

            if (e.Parameter == typeof(HomePage))
            {
                var recentlyAddedSamples = allSamples.Where(metadata => metadata.IsRecentlyAdded).Reverse();
                StyledGrid.ItemsSource = recentlyAddedSamples;
            }
            else
            {
                allSamples.Sort((left, right) => left.Title.CompareTo(right.Title));
                StyledGrid.ItemsSource = allSamples;
            }
        }
Beispiel #3
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            sampleMetadata = (SampleMetadata)e.Parameter;
            switch (sampleMetadata.Tag)
            {
            case "ImageClassifier":
                SampleFrame.Navigate(typeof(Samples.ImageClassifier));
                break;

            case "Batching":
                SampleFrame.Navigate(typeof(Samples.Batching));
                break;

            case "ImageEffects":
                SampleFrame.Navigate(typeof(Samples.ImageEffects));
                break;

            case "OpenCVInterop":
                SampleFrame.Navigate(typeof(Samples.OpenCVInterop));
                break;

            case "ImageSharpInterop":
                SampleFrame.Navigate(typeof(Samples.ImageSharpInterop));
                break;

            case "EncryptedModel":
                SampleFrame.Navigate(typeof(Samples.EncryptedModel));
                break;

            case "AdapterSelection":
                SampleFrame.Navigate(typeof(Samples.AdapterSelection));
                break;
            }
            if (sampleMetadata.Docs.Count > 0)
            {
                DocsHeader.Visibility = Visibility.Visible;
            }
            else
            {
                DocsHeader.Visibility = Visibility.Collapsed;
            }
        }