public FlipViewIndicator()
        {
            this.InitializeComponent();

            _model = new FlipViewModel();
#if SDKVERSION_14393
            SampleDefinition shyHeader = SampleDefinitions.Definitions.Where(x => x.Type == typeof(ShyHeader)).FirstOrDefault();
            if (shyHeader != null)
            {
                _model.FlipViewItems.Add(new FeaturedFlipViewSample("Create a shrinking header tied to scroll position", "", "/Assets/BannerImages/ShyHeader.PNG", shyHeader));
            }
            SampleDefinition interactions3D = SampleDefinitions.Definitions.Where(x => x.Type == typeof(Interactions3D)).FirstOrDefault();
            if (interactions3D != null)
            {
                _model.FlipViewItems.Add(new FeaturedFlipViewSample("Interaction Tracker 3D", "", "/Assets/BannerImages/IneractionTrackerBanner.png", interactions3D));
            }
            SampleDefinition pullToAnimate = SampleDefinitions.Definitions.Where(x => x.Type == typeof(PullToAnimate)).FirstOrDefault();
            if (pullToAnimate != null)
            {
                _model.FlipViewItems.Add(new FeaturedFlipViewSample("Create custom resting points with animation", "", "/Assets/BannerImages/PullToAnimateBanner.PNG", pullToAnimate));
            }
            this.DataContext = _model;
#endif

            // Automatically have the FlipView progress to the next item
            if (Model.FlipViewItems.Count() > 1)
            {
                Task t = ProgressFlipView();
            }
        }
Exemplo n.º 2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            SampleDefinition definition = (SampleDefinition)e.Parameter;

            ContentFrame.Navigate(definition.Type, this);
        }
 public FeaturedFlipViewSample(string title, string description, string backgroundImageUrl, SampleDefinition sampleDefinition = null, string navigationUrl = null)
 {
     _title            = title;
     _Description      = description;
     _navigationUrl    = navigationUrl;
     _backgroundImage  = backgroundImageUrl;
     _sampleDefinition = sampleDefinition;
 }
Exemplo n.º 4
0
        private void SampleList_ItemClick(object sender, ItemClickEventArgs e)
        {
            SampleDefinition definition = e.ClickedItem as SampleDefinition;

            MainPage.Instance.NavigateToPage(typeof(SampleHost), definition);

            SamplesSplitView.IsPaneOpen = false;
        }
Exemplo n.º 5
0
        // When a sample item is clicked, walk up and find the parent frame and
        // have that frame navigate to the sample
        public static void NavigateToSample(object sender, ItemClickEventArgs e)
        {
            Frame pivotItemFrame = GetPivotFrame((FrameworkElement)sender);

            if (pivotItemFrame != null)
            {
                SampleDefinition sample = (SampleDefinition)e.ClickedItem;
                pivotItemFrame.Navigate(typeof(SampleHost), sample);
            }
        }
Exemplo n.º 6
0
        public static void FeaturedSampleList_ItemClick(object sender, ItemClickEventArgs e)
        {
            SampleDefinition sample = (SampleDefinition)e.ClickedItem;

            foreach (SampleDefinition definition in SampleDefinitions.Definitions)
            {
                if (sample.Name == definition.Name)
                {
                    MainPage.Instance.NavigateToPage(typeof(SampleHost), definition);
                    break;
                }
            }
        }
Exemplo n.º 7
0
        public FlipViewIndicator()
        {
            this.InitializeComponent();

            _model = new FlipViewModel();
#if SDKVERSION_14393
            SampleDefinition item1 = SampleDefinitions.Definitions.Where(x => x.Type == typeof(Interactions3D)).FirstOrDefault();
            SampleDefinition item2 = SampleDefinitions.Definitions.Where(x => x.Type == typeof(PullToAnimate)).FirstOrDefault();
            _model.FlipViewItems.Add(new FeaturedFlipViewSample("Interaction Tracker 3D", "", "/Assets/BannerImages/IneractionTrackerBanner.png", item1));
            _model.FlipViewItems.Add(new FeaturedFlipViewSample("Create custom resting points with animation", "", "/Assets/BannerImages/PullToAnimateBanner.PNG", item2));
            this.DataContext = _model;
#endif

            // Automatically have the FlipView progress to the next item
            if (Model.FlipViewItems.Count() > 1)
            {
                Task t = ProgressFlipView();
            }
        }
Exemplo n.º 8
0
        private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
        {
            if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
            {
                var matches = from sampleDef in SampleDefinitions.Definitions
                              where sampleDef.DisplayName.IndexOf(sender.Text, StringComparison.CurrentCultureIgnoreCase) >= 0 ||
                              (sampleDef.Tags != null && sampleDef.Tags.Any(str => str.IndexOf(sender.Text, StringComparison.CurrentCultureIgnoreCase) >= 0))
                              select sampleDef;

                if (matches.Count() > 0)
                {
                    SearchBox.ItemsSource = matches.OrderByDescending(i => i.DisplayName.StartsWith(sender.Text, StringComparison.CurrentCultureIgnoreCase)).ThenBy(i => i.DisplayName);
                }
                else
                {
                    _dummySampleDefinition = new SampleDefinition("No results found", null, SampleType.Reference, SampleCategory.APIReference, false, false);
                    SearchBox.ItemsSource  = new SampleDefinition[] { _dummySampleDefinition };
                }
            }
        }
        public FlipViewIndicator()
        {
            this.InitializeComponent();

            _model = new FlipViewModel();

#if SDKVERSION_15063
            SampleDefinition brushInterop = SampleDefinitions.Definitions.Where(x => x.Type == typeof(BrushInterop)).FirstOrDefault();
            if (brushInterop != null)
            {
                _model.FlipViewItems.Add(new FeaturedFlipViewSample("Apply custom brushes to XAML content", "", "/Assets/BannerImages/BrushInterop.png", brushInterop));
            }
            this.DataContext = _model;
            SampleDefinition shyHeader = SampleDefinitions.Definitions.Where(x => x.Type == typeof(ShyHeader)).FirstOrDefault();
            if (shyHeader != null)
            {
                _model.FlipViewItems.Add(new FeaturedFlipViewSample("Create a shrinking header tied to scroll position", "", "/Assets/BannerImages/ShyHeader.PNG", shyHeader));
            }
            SampleDefinition pullToAnimate = SampleDefinitions.Definitions.Where(x => x.Type == typeof(PullToAnimate)).FirstOrDefault();
            if (pullToAnimate != null)
            {
                _model.FlipViewItems.Add(new FeaturedFlipViewSample("Create depth of field with manipulation-based blur", "", "/Assets/BannerImages/PullToAnimateBanner.PNG", pullToAnimate));
            }
            this.DataContext = _model;
            SampleDefinition interactions3D = SampleDefinitions.Definitions.Where(x => x.Type == typeof(Interactions3D)).FirstOrDefault();
            if (interactions3D != null)
            {
                _model.FlipViewItems.Add(new FeaturedFlipViewSample("Create an interactive 3D experience", "", "/Assets/BannerImages/IneractionTrackerBanner.png", interactions3D));
            }
            this.DataContext = _model;
#endif

            // Automatically have the FlipView progress to the next item
            if (Model.FlipViewItems.Count() > 1)
            {
                Task t = ProgressFlipView();
            }
        }
        private void SampleList_ItemClick(object sender, ItemClickEventArgs e)
        {
            SampleDefinition definition = e.ClickedItem as SampleDefinition;

            ((Frame)Window.Current.Content).Navigate(typeof(SampleHost), definition);
        }
 public static void NavigateToSample(SampleDefinition sample)
 {
     s_instance._hostingUI.Navigate(typeof(SampleHost), sample);
 }