public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-resource://wikipediaquerytoolxaml/Files/SplitPage.xaml")); CollectionViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("CollectionViewSource"); LayoutRoot = (Windows.UI.Xaml.Controls.Grid)this.FindName("LayoutRoot"); OrientationStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("OrientationStates"); Full = (Windows.UI.Xaml.VisualState)this.FindName("Full"); Fill = (Windows.UI.Xaml.VisualState)this.FindName("Fill"); Portrait = (Windows.UI.Xaml.VisualState)this.FindName("Portrait"); PortraitDetail = (Windows.UI.Xaml.VisualState)this.FindName("PortraitDetail"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); SnappedDetail = (Windows.UI.Xaml.VisualState)this.FindName("SnappedDetail"); PrimaryColumn = (Windows.UI.Xaml.Controls.ColumnDefinition)this.FindName("PrimaryColumn"); TitlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("TitlePanel"); ItemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView"); ItemDetail = (Windows.UI.Xaml.Controls.ContentControl)this.FindName("ItemDetail"); ItemStackPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("ItemStackPanel"); BackButton = (Windows.UI.Xaml.Controls.Button)this.FindName("BackButton"); PageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PageTitle"); }
private void OnStateChanged(VisualState state) { var showHints = state != STATE_SMALL; statusYesView.ShowStatusHints = showHints; statusLimitedView.ShowStatusHints = showHints; statusNoView.ShowStatusHints = showHints; statusUnknownView.ShowStatusHints = showHints; }
public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///ItemDetailPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (ContosoCookbook.Common.LayoutAwarePage) this.FindName("pageRoot"); itemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource) this.FindName("itemsViewSource"); PageAppBar = (Windows.UI.Xaml.Controls.AppBar) this.FindName("PageAppBar"); LeftCommands = (Windows.UI.Xaml.Controls.StackPanel) this.FindName("LeftCommands"); RightCommands = (Windows.UI.Xaml.Controls.StackPanel) this.FindName("RightCommands"); BragButton = (Windows.UI.Xaml.Controls.Button) this.FindName("BragButton"); PinRecipeButton = (Windows.UI.Xaml.Controls.Button) this.FindName("PinRecipeButton"); flipView = (Windows.UI.Xaml.Controls.FlipView) this.FindName("flipView"); portraitFlipView = (Windows.UI.Xaml.Controls.FlipView) this.FindName("portraitFlipView"); snappedFlipView = (Windows.UI.Xaml.Controls.FlipView) this.FindName("snappedFlipView"); backButton = (Windows.UI.Xaml.Controls.Button) this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("pageTitle"); ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup) this.FindName("ApplicationViewStates"); FullScreenLandscape = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState) this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState) this.FindName("Snapped"); }
public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///HomePage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (_8Tracks.Common.LayoutAwarePage) this.FindName("pageRoot"); groupedItemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource) this.FindName("groupedItemsViewSource"); passwordPrompt = (Windows.UI.Xaml.Controls.Grid) this.FindName("passwordPrompt"); itemGridView = (Windows.UI.Xaml.Controls.GridView) this.FindName("itemGridView"); itemListView = (Windows.UI.Xaml.Controls.ListView) this.FindName("itemListView"); backButton = (Windows.UI.Xaml.Controls.Button) this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("pageTitle"); loginText = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("loginText"); loginBox = (Windows.UI.Xaml.Controls.TextBox) this.FindName("loginBox"); passwordText = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("passwordText"); passwordBox = (Windows.UI.Xaml.Controls.PasswordBox) this.FindName("passwordBox"); doneButton = (Windows.UI.Xaml.Controls.Button) this.FindName("doneButton"); ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup) this.FindName("ApplicationViewStates"); FullScreenLandscape = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState) this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState) this.FindName("Snapped"); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///SplitPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (NoelBlogReader.Common.LayoutAwarePage)this.FindName("pageRoot"); itemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("itemsViewSource"); primaryColumn = (Windows.UI.Xaml.Controls.ColumnDefinition)this.FindName("primaryColumn"); titlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("titlePanel"); itemListScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer"); itemDetail = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemDetail"); itemDetailGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("itemDetailGrid"); itemTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("itemTitle"); contentViewBorder = (Windows.UI.Xaml.Controls.Border)this.FindName("contentViewBorder"); contentView = (Windows.UI.Xaml.Controls.WebView)this.FindName("contentView"); contentViewRect = (Windows.UI.Xaml.Shapes.Rectangle)this.FindName("contentViewRect"); itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); FullScreenPortrait_Detail = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait_Detail"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); Snapped_Detail = (Windows.UI.Xaml.VisualState)this.FindName("Snapped_Detail"); }
public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-resource://spotifyapp/Files/View/DetailPage.xaml")); CollectionViewSource = (Windows.UI.Xaml.Data.CollectionViewSource) this.FindName("CollectionViewSource"); LayoutRoot = (Windows.UI.Xaml.Controls.Grid) this.FindName("LayoutRoot"); OrientationStates = (Windows.UI.Xaml.VisualStateGroup) this.FindName("OrientationStates"); Full = (Windows.UI.Xaml.VisualState) this.FindName("Full"); Fill = (Windows.UI.Xaml.VisualState) this.FindName("Fill"); Portrait = (Windows.UI.Xaml.VisualState) this.FindName("Portrait"); Snapped = (Windows.UI.Xaml.VisualState) this.FindName("Snapped"); FlipView = (Windows.UI.Xaml.Controls.FlipView) this.FindName("FlipView"); ApplicationBar = (Windows.UI.Xaml.Controls.ApplicationBar) this.FindName("ApplicationBar"); NextPanel = (Windows.UI.Xaml.Controls.StackPanel) this.FindName("NextPanel"); NextButton = (Windows.UI.Xaml.Controls.Button) this.FindName("NextButton"); PreviousButton = (Windows.UI.Xaml.Controls.Button) this.FindName("PreviousButton"); HomeButton = (Windows.UI.Xaml.Controls.Button) this.FindName("HomeButton"); BackButton = (Windows.UI.Xaml.Controls.Button) this.FindName("BackButton"); PageTitle = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("PageTitle"); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///HomePage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (_8Tracks.Common.LayoutAwarePage)this.FindName("pageRoot"); groupedItemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("groupedItemsViewSource"); passwordPrompt = (Windows.UI.Xaml.Controls.Grid)this.FindName("passwordPrompt"); itemGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("itemGridView"); itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); loginText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("loginText"); loginBox = (Windows.UI.Xaml.Controls.TextBox)this.FindName("loginBox"); passwordText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("passwordText"); passwordBox = (Windows.UI.Xaml.Controls.PasswordBox)this.FindName("passwordBox"); doneButton = (Windows.UI.Xaml.Controls.Button)this.FindName("doneButton"); ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("ApplicationViewStates"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///BlankPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); FullGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("FullGrid"); SnapGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("SnapGrid"); PortaitGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("PortaitGrid"); textBlock = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("textBlock"); ContentView2 = (Windows.UI.Xaml.Controls.WebView)this.FindName("ContentView2"); ItemListView1 = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView1"); ContentView1 = (Windows.UI.Xaml.Controls.WebView)this.FindName("ContentView1"); TitleText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("TitleText"); grid = (Windows.UI.Xaml.Controls.Grid)this.FindName("grid"); ItemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView"); PostTitleText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PostTitleText"); ContentView = (Windows.UI.Xaml.Controls.WebView)this.FindName("ContentView"); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///Tweet.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (Mu_genotype1.Common.LayoutAwarePage)this.FindName("pageRoot"); primaryColumn = (Windows.UI.Xaml.Controls.ColumnDefinition)this.FindName("primaryColumn"); titlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("titlePanel"); itemListScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer"); itemListScrollViewer2 = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer2"); PeerTweets = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PeerTweets"); itemListView2 = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView2"); TweetBox = (Windows.UI.Xaml.Controls.TextBox)this.FindName("TweetBox"); TweetIt = (Windows.UI.Xaml.Controls.Button)this.FindName("TweetIt"); PinPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("PinPanel"); itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView"); PinTb = (Windows.UI.Xaml.Controls.TextBox)this.FindName("PinTb"); VerifyPinButton = (Windows.UI.Xaml.Controls.Button)this.FindName("VerifyPinButton"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); pageSubtitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageSubtitle"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); FullScreenPortrait_Detail = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait_Detail"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); Snapped_Detail = (Windows.UI.Xaml.VisualState)this.FindName("Snapped_Detail"); TwitterConnectBtn = (Windows.UI.Xaml.Controls.Button)this.FindName("TwitterConnectBtn"); RefreshButton = (Windows.UI.Xaml.Controls.Button)this.FindName("RefreshButton"); }
public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///SearchResultsPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (SimpleSearchProvider.Common.LayoutAwarePage) this.FindName("pageRoot"); resultsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource) this.FindName("resultsViewSource"); filtersViewSource = (Windows.UI.Xaml.Data.CollectionViewSource) this.FindName("filtersViewSource"); resultsPanel = (Windows.UI.Xaml.Controls.Grid) this.FindName("resultsPanel"); noResultsTextBlock = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("noResultsTextBlock"); typicalPanel = (Windows.UI.Xaml.Controls.Grid) this.FindName("typicalPanel"); snappedPanel = (Windows.UI.Xaml.Controls.Grid) this.FindName("snappedPanel"); resultsListView = (Windows.UI.Xaml.Controls.ListView) this.FindName("resultsListView"); filtersItemsControl = (Windows.UI.Xaml.Controls.ItemsControl) this.FindName("filtersItemsControl"); resultsGridView = (Windows.UI.Xaml.Controls.GridView) this.FindName("resultsGridView"); backButton = (Windows.UI.Xaml.Controls.Button) this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("pageTitle"); resultText = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("resultText"); queryText = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("queryText"); ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup) this.FindName("ApplicationViewStates"); ResultStates = (Windows.UI.Xaml.VisualStateGroup) this.FindName("ResultStates"); ResultsFound = (Windows.UI.Xaml.VisualState) this.FindName("ResultsFound"); NoResultsFound = (Windows.UI.Xaml.VisualState) this.FindName("NoResultsFound"); FullScreenLandscape = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState) this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState) this.FindName("Snapped"); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///ArtistDetails.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (Mu_genotype1.Common.LayoutAwarePage)this.FindName("pageRoot"); primaryColumn = (Windows.UI.Xaml.Controls.ColumnDefinition)this.FindName("primaryColumn"); titlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("titlePanel"); itemListScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer"); itemDetail = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemDetail"); itemDetailGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("itemDetailGrid"); itemDetailTitlePanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("itemDetailTitlePanel"); ArtistContentTb = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("ArtistContentTb"); itemTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("itemTitle"); itemSubtitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("itemSubtitle"); itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); FullScreenPortrait_Detail = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait_Detail"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); Snapped_Detail = (Windows.UI.Xaml.VisualState)this.FindName("Snapped_Detail"); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-resource://spotifyapp/Files/View/CollectionSummaryPage.xaml")); CollectionViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("CollectionViewSource"); LayoutRoot = (Windows.UI.Xaml.Controls.Grid)this.FindName("LayoutRoot"); OrientationStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("OrientationStates"); Full = (Windows.UI.Xaml.VisualState)this.FindName("Full"); Fill = (Windows.UI.Xaml.VisualState)this.FindName("Fill"); Portrait = (Windows.UI.Xaml.VisualState)this.FindName("Portrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); ScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("ScrollViewer"); CategoryPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("CategoryPanel"); HeaderTitlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("HeaderTitlePanel"); ItemGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("ItemGridView"); ItemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView"); Title = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("Title"); Image = (Windows.UI.Xaml.Controls.Image)this.FindName("Image"); DescriptionText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("DescriptionText"); BackButton = (Windows.UI.Xaml.Controls.Button)this.FindName("BackButton"); PageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PageTitle"); }
private void OnSizeChanged(object sender, SizeChangedEventArgs e) { // How much room do we have? double gridMargin = 20; double gridWidth = e.NewSize.Width - gridMargin; // How much do we allow for each item? const double itemWidth = 330; // We want at least 3 across if (itemWidth * 3 <= gridWidth) { if (currentVisualState != VisualState.Big) { VisualStateManager.GoToState(this, "BigScreen", false); currentVisualState = VisualState.Big; } } else { if (currentVisualState != VisualState.Small) { VisualStateManager.GoToState(this, "SmallScreen", false); currentVisualState = VisualState.Small; } } }
public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-resource://spotifyapp/Files/View/CollectionSummaryPage.xaml")); CollectionViewSource = (Windows.UI.Xaml.Data.CollectionViewSource) this.FindName("CollectionViewSource"); LayoutRoot = (Windows.UI.Xaml.Controls.Grid) this.FindName("LayoutRoot"); OrientationStates = (Windows.UI.Xaml.VisualStateGroup) this.FindName("OrientationStates"); Full = (Windows.UI.Xaml.VisualState) this.FindName("Full"); Fill = (Windows.UI.Xaml.VisualState) this.FindName("Fill"); Portrait = (Windows.UI.Xaml.VisualState) this.FindName("Portrait"); Snapped = (Windows.UI.Xaml.VisualState) this.FindName("Snapped"); ScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer) this.FindName("ScrollViewer"); CategoryPanel = (Windows.UI.Xaml.Controls.StackPanel) this.FindName("CategoryPanel"); HeaderTitlePanel = (Windows.UI.Xaml.Controls.Grid) this.FindName("HeaderTitlePanel"); ItemGridView = (Windows.UI.Xaml.Controls.GridView) this.FindName("ItemGridView"); ItemListView = (Windows.UI.Xaml.Controls.ListView) this.FindName("ItemListView"); Title = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("Title"); Image = (Windows.UI.Xaml.Controls.Image) this.FindName("Image"); DescriptionText = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("DescriptionText"); BackButton = (Windows.UI.Xaml.Controls.Button) this.FindName("BackButton"); PageTitle = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("PageTitle"); }
private void AdaptiveStates_CurrentStateChanged(object sender , VisualStateChangedEventArgs e) { if (e.NewState == NarrowState && e.NewState != lastState && detailView.ItemsSource != null) { SetColumnWidthOfDetailView(); lastState = e.NewState; } }
private void PublishNarrowMessage(VisualState currentVisualState) { bool isNarrow = currentVisualState == NarrowState; var navTransition = Transitions[0] as NavigationThemeTransition; navTransition.DefaultNavigationTransitionInfo = MasterListView.SelectedItem != null ? (NavigationTransitionInfo)new DrillInNavigationTransitionInfo() : (NavigationTransitionInfo)new SuppressNavigationTransitionInfo(); Messenger.Default.Send<NarrowMessage>(new NarrowMessage(Const.MOVIES_VIEW, isNarrow)); }
/// <summary> /// Do some extra action on VisualStateChanged. /// </summary> /// <param name="state"></param> private void OnStateChanged(VisualState state) { Log.d("New State Changed: " + state.Name); if (state == STATE_SMALL) { OnSmallState(); } else if (state == STATE_MEDIUM) { OnMediumState(); } else { OnBigState(); } this.RefreshCanGoBack(); }
protected override bool GoToStateCore(Control control, FrameworkElement stateGroupsRoot, string stateName, VisualStateGroup group, VisualState state, bool useTransitions) { if ((group == null) || (state == null)) { return false; } if (control == null) { control = new ContentControl(); } return base.GoToStateCore(control, stateGroupsRoot, stateName, group, state, useTransitions); }
private void UpdateForVisualState(VisualState newState, VisualState oldState = null) { var isNarrow = newState == NarrowState; if (isNarrow && oldState == this.DefaultState && selectedNote != null) { // Resize down to the detail item. Don't play a transition. Frame.Navigate(typeof(DetailPage), this.selectedNote, new SuppressNavigationTransitionInfo()); } EntranceNavigationTransitionInfo.SetIsTargetElement(MasterListView, isNarrow); if (this.DetailContentPresenter != null) { EntranceNavigationTransitionInfo.SetIsTargetElement(DetailContentPresenter, !isNarrow); } }
private void UpdateForVisualState(VisualState newState, VisualState oldState = null) { var isNarrow = newState == NarrowState; if (isNarrow && oldState == DefaultState && _lastSelectedItem != null) { // Resize down to the detail item. Don't play a transition. App.RootFrame.Navigate(typeof(StickerDetailSelectionPage), null, new SuppressNavigationTransitionInfo()); } EntranceNavigationTransitionInfo.SetIsTargetElement(MasterListView, isNarrow); //if (DetailContentPresenter != null) //{ // EntranceNavigationTransitionInfo.SetIsTargetElement(DetailContentPresenter, !isNarrow); //} }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///RegisterPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (StreetFoo.Client.UI.Common.LayoutAwarePage)this.FindName("pageRoot"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); }
static bool ShouldIntercept(Control control, Windows.UI.Xaml.VisualState state, string stateName) { if (state == null || state.Name == "Normal") { // We don't intercept the "Normal" state, that's the base state onto which Forms applies properties return(false); } // Retrieve the VisualElement we're managing states for var visualElement = GetFormsElement(control); if (visualElement == null) { return(false); } // Retrieve the set of VisualStateGroups for the VisualElement var groups = VisualStateManager.GetVisualStateGroups(visualElement); if (groups == null) { // No groups? // Then the user disabled legacy color management through the platform specific, not by using the XFVSM // So our ignored states lists is effectively "Disabled" and "Focused" if (state.Name == "Disabled" || state.Name == "Focused") { return(true); } } else { // Check the states the XFVSM is managing foreach (VisualStateGroup vsg in groups) { foreach (VisualState vs in vsg.States) { if (vs.Name == stateName) { // The XFVSM is already handling this state, so don't let the Windows VSM do it return(true); } } } } return(false); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///AddStation.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (Metarma.Common.LayoutAwarePage)this.FindName("pageRoot"); RootPanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("RootPanel"); ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("ApplicationViewStates"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); StationIDText = (Windows.UI.Xaml.Controls.TextBox)this.FindName("StationIDText"); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///BasicPage1.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (TheBellyofAuthority.Common.LayoutAwarePage)this.FindName("pageRoot"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("ApplicationViewStates"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); }
public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///Copy of RegisterPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (StreetFoo.Client.UI.Common.LayoutAwarePage) this.FindName("pageRoot"); backButton = (Windows.UI.Xaml.Controls.Button) this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("pageTitle"); FullScreenLandscape = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState) this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState) this.FindName("Snapped"); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///BasicPage1.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (key_control_image_sample.Common.LayoutAwarePage)this.FindName("pageRoot"); canv1 = (Windows.UI.Xaml.Controls.Canvas)this.FindName("canv1"); rect = (Windows.UI.Xaml.Shapes.Rectangle)this.FindName("rect"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); }
protected override void OnApplyTemplate() { base.OnApplyTemplate(); _rootGrid = GetTemplateChild("RootGrid") as Windows.UI.Xaml.Controls.Grid; if (_rootGrid != null) { var stateGroups = WVisualStateManager.GetVisualStateGroups(_rootGrid).ToList(); _DeleteButtonVisibleStateGroups = stateGroups.SingleOrDefault(sg => sg.Name == "ButtonStates"); if (_DeleteButtonVisibleStateGroups != null) { _DeleteButtonVisibleState = _DeleteButtonVisibleStateGroups.States.SingleOrDefault(s => s.Name == "ButtonVisible"); } UpdateClearButtonVisible(); } _scrollViewer = GetTemplateChild("ContentElement") as ScrollViewer; }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///ItemDetailPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (Jcl.Navigate.Presentation.Metro.Common.LayoutAwarePage)this.FindName("pageRoot"); itemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("itemsViewSource"); flipView = (Windows.UI.Xaml.Controls.FlipView)this.FindName("flipView"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if(IsWeekend(DateTime.Today)) { pivotItemToday.Template = this.Resources["MasterListViewEmptyTemplate"] as ControlTemplate; } else { pivotItemToday.DataContext = new ViewModel.MainPageViewModelToday(); } if(IsWeekend(DateTime.Today.AddDays(1))) { pivotItemTomorrow.Header = "Montag"; } pivotItemTomorrow.DataContext = new ViewModel.MainPageViewModelTomorrow(); Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += MainPage_BackRequested; lastState = AdaptiveStates.CurrentState; }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///Auto Viewer.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (Metro_Media_Streamer.Common.LayoutAwarePage)this.FindName("pageRoot"); image11 = (Windows.UI.Xaml.Controls.Image)this.FindName("image11"); image22 = (Windows.UI.Xaml.Controls.Image)this.FindName("image22"); b11 = (Windows.UI.Xaml.Controls.Button)this.FindName("b11"); b22 = (Windows.UI.Xaml.Controls.Button)this.FindName("b22"); ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("ApplicationViewStates"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); }
private void OnSizeChanged(object sender, SizeChangedEventArgs e) { var width = e.NewSize.Width; var newVisualState = currentVisualState; if (width > 1000) newVisualState = VisualState.Big; else if (width > 350) newVisualState = VisualState.Small; else newVisualState = VisualState.Tiny; if (currentVisualState != newVisualState) { VisualStateManager.GoToState(this, newVisualState.ToString(), false); currentVisualState = newVisualState; } }
private static bool TryGetState(FrameworkElement element, string stateName, out VisualStateGroup group, out VisualState state) { group = null; state = null; foreach (VisualStateGroup group2 in VisualStateManager.GetVisualStateGroups(element)) { foreach (VisualState state2 in group2.States) { if (state2.Name == stateName) { group = group2; state = state2; return true; } } } return false; }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///RecoArtists.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (Mu_genotype1.Common.LayoutAwarePage)this.FindName("pageRoot"); itemGridScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemGridScrollViewer"); itemListScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer"); itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView"); itemGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("itemGridView"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-resource://matchit/Files/GroupedCollectionPage.xaml")); GroupedCollectionViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("GroupedCollectionViewSource"); LayoutRoot = (Windows.UI.Xaml.Controls.Grid)this.FindName("LayoutRoot"); OrientationStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("OrientationStates"); Full = (Windows.UI.Xaml.VisualState)this.FindName("Full"); Fill = (Windows.UI.Xaml.VisualState)this.FindName("Fill"); Portrait = (Windows.UI.Xaml.VisualState)this.FindName("Portrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); ItemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView"); ItemGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("ItemGridView"); BackButton = (Windows.UI.Xaml.Controls.Button)this.FindName("BackButton"); PageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PageTitle"); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///GroupDetailPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (dbaV1.Common.LayoutAwarePage)this.FindName("pageRoot"); itemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("itemsViewSource"); gridScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("gridScrollViewer"); snappedScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("snappedScrollViewer"); gridLayoutPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("gridLayoutPanel"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///GroupDetailPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (ChampionshipOrganizer.Common.LayoutAwarePage)this.FindName("pageRoot"); itemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("itemsViewSource"); itemGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("itemGridView"); itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("ApplicationViewStates"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); }
private void UpdateForVisualState(VisualState newState, VisualState oldState = null) { var selectedItem = AppManager.EcosApp.ActiveProfile.FeedbackManager.SelectedItem; var isNarrow = newState == NarrowState; if (!isNarrow) { MasterColumn.Width = (GridLength) Application.Current.Resources["MasterColumnWidth"]; DetailColumn.Width = new GridLength(1, GridUnitType.Star); } else { MasterColumn.Width = selectedItem != null ? new GridLength(0) : new GridLength(1, GridUnitType.Star); DetailColumn.Width = selectedItem != null ? new GridLength(1, GridUnitType.Star) : new GridLength(0); } EntranceNavigationTransitionInfo.SetIsTargetElement(lvFeedbackModulesList, isNarrow); if (DetailContentPresenter != null) EntranceNavigationTransitionInfo.SetIsTargetElement(DetailContentPresenter, !isNarrow); }
public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///ItemDetailPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (_8Tracks.Common.LayoutAwarePage) this.FindName("pageRoot"); itemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource) this.FindName("itemsViewSource"); flipView = (Windows.UI.Xaml.Controls.FlipView) this.FindName("flipView"); backButton = (Windows.UI.Xaml.Controls.Button) this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("pageTitle"); ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup) this.FindName("ApplicationViewStates"); FullScreenLandscape = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState) this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState) this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState) this.FindName("Snapped"); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///DetailPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (NoelBlogReader.Common.LayoutAwarePage)this.FindName("pageRoot"); itemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("itemsViewSource"); PopInStoryboard = (Windows.UI.Xaml.Media.Animation.Storyboard)this.FindName("PopInStoryboard"); contentViewBorder = (Windows.UI.Xaml.Controls.Border)this.FindName("contentViewBorder"); flipView = (Windows.UI.Xaml.Controls.FlipView)this.FindName("flipView"); contentView = (Windows.UI.Xaml.Controls.WebView)this.FindName("contentView"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); }
protected override void OnApplyTemplate() { base.OnApplyTemplate(); if (Device.Idiom == TargetIdiom.Phone) { // If we're on the phone, we need to grab this from the template // so we can manually handle its background when focused _borderElement = (Border)GetTemplateChild("BorderElement"); } _rootGrid = (Windows.UI.Xaml.Controls.Grid)GetTemplateChild("RootGrid"); if (_rootGrid != null) { var stateGroups = WVisualStateManager.GetVisualStateGroups(_rootGrid).ToList(); _DeleteButtonVisibleStateGroups = stateGroups.SingleOrDefault(sg => sg.Name == "ButtonStates"); if (_DeleteButtonVisibleStateGroups != null) { _DeleteButtonVisibleState = _DeleteButtonVisibleStateGroups.States.SingleOrDefault(s => s.Name == "ButtonVisible"); } } }
public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-resource://spotifyapp/Files/View/GroupedCollectionPage.xaml")); GroupedCollectionViewSource = (Windows.UI.Xaml.Data.CollectionViewSource) this.FindName("GroupedCollectionViewSource"); LayoutRoot = (Windows.UI.Xaml.Controls.Grid) this.FindName("LayoutRoot"); OrientationStates = (Windows.UI.Xaml.VisualStateGroup) this.FindName("OrientationStates"); Full = (Windows.UI.Xaml.VisualState) this.FindName("Full"); Fill = (Windows.UI.Xaml.VisualState) this.FindName("Fill"); Portrait = (Windows.UI.Xaml.VisualState) this.FindName("Portrait"); Snapped = (Windows.UI.Xaml.VisualState) this.FindName("Snapped"); AppBar = (Windows.UI.Xaml.Controls.ApplicationBar) this.FindName("AppBar"); ItemListView = (Windows.UI.Xaml.Controls.ListView) this.FindName("ItemListView"); ItemGridView = (Windows.UI.Xaml.Controls.GridView) this.FindName("ItemGridView"); BackButton = (Windows.UI.Xaml.Controls.Button) this.FindName("BackButton"); PageTitle = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("PageTitle"); SearchTextBox = (Windows.UI.Xaml.Controls.TextBox) this.FindName("SearchTextBox"); }
internal void GoToState(IFrameworkElement element, VisualState state, VisualState originalState, bool useTransitions, Action onStateChanged) { if (this.Log().IsEnabled(Microsoft.Extensions.Logging.LogLevel.Debug)) { this.Log().DebugFormat("Go to state [{0}/{1}] on [{2}]", Name, state?.Name, element); } var transition = FindTransition(originalState?.Name, state?.Name); EventHandler <object> onComplete = null; onComplete = (s, a) => { onStateChanged(); if (state?.Storyboard == null) { return; } state.Storyboard.Completed -= onComplete; }; EventHandler <object> onTransitionComplete = null; onTransitionComplete = (s, a) => { if (transition?.Storyboard != null && useTransitions) { transition.Storyboard.Completed -= onTransitionComplete; if (state?.Storyboard != null) { transition.Storyboard.TurnOverAnimationsTo(state.Storyboard); } } //Starts Storyboard Animation if (state?.Storyboard == null) { onComplete(this, null); } else if (state != null) { state.Storyboard.Completed += onComplete; state.Storyboard.Begin(); } }; //Stops Previous Storyboard Animation if (originalState != null) { if (originalState.Storyboard != null) { if (transition?.Storyboard != null) { originalState.Storyboard.TurnOverAnimationsTo(transition.Storyboard); } else if (state?.Storyboard != null) { originalState.Storyboard.TurnOverAnimationsTo(state.Storyboard); } else { originalState.Storyboard.Stop(); } } foreach (var setter in this.CurrentState.Setters.OfType <Setter>()) { if (element != null && (state?.Setters.OfType <Setter>().Any(o => o.HasSameTarget(setter, DependencyPropertyValuePrecedences.Animations, element)) ?? false)) { // PERF: We clear the value of the current setter only if there isn't any setter in the target state // which changes the same target property. if (this.Log().IsEnabled(LogLevel.Debug)) { this.Log().Debug($"Ignoring reset of setter of '{setter.Target?.Path}' as it will be updated again by '{state.Name}'"); } continue; } setter.ClearValue(); } } this.CurrentState = state; if (this.CurrentState != null && element != null) { foreach (var setter in this.CurrentState.Setters.OfType <Setter>()) { setter.ApplyValue(DependencyPropertyValuePrecedences.Animations, element); } } if (transition?.Storyboard == null || !useTransitions) { onTransitionComplete(this, null); } else { transition.Storyboard.Completed += onTransitionComplete; transition.Storyboard.Begin(); } }
void UpdateOnColor() { if (!(Cell is SwitchCell switchCell)) { return; } var color = switchCell.OnColor == Color.Default ? _defaultOnColor : new SolidColorBrush(switchCell.OnColor.ToWindowsColor()); var nativeSwitch = FrameworkElementExtensions.GetFirstDescendant <ToggleSwitch>(this); // change fill color in switch rectangle var rects = nativeSwitch.GetDescendantsByName <Windows.UI.Xaml.Shapes.Rectangle>("SwitchKnobBounds"); foreach (var rect in rects) { rect.Fill = color; } // change color in animation on PointerOver var grid = nativeSwitch.GetFirstDescendant <Windows.UI.Xaml.Controls.Grid>(); var gridVisualStateGroups = Windows.UI.Xaml.VisualStateManager.GetVisualStateGroups(grid); Windows.UI.Xaml.VisualStateGroup vsGroup = null; foreach (var visualGroup in gridVisualStateGroups) { if (visualGroup.Name == "CommonStates") { vsGroup = visualGroup; break; } } if (vsGroup == null) { return; } Windows.UI.Xaml.VisualState vState = null; foreach (var visualState in vsGroup.States) { if (visualState.Name == "PointerOver") { vState = visualState; break; } } if (vState == null) { return; } var visualStates = vState.Storyboard.Children; foreach (ObjectAnimationUsingKeyFrames item in visualStates) { if ((string)item.GetValue(Storyboard.TargetNameProperty) == "SwitchKnobBounds") { item.KeyFrames[0].Value = color; break; } } }
// For most of the UWP controls, this custom VisualStateManager is injected to prevent the default Windows // VSM from handling states which the Forms VSM is already managing. // The exception are the controls which are built on TextBox (SearchBar, Entry, Editor); there's a UWP // bug wherein the GoToStateCore override for those controls is never called (Item 10976357 in VSTS) // So until that's resolved, the FormsTextBox control is doing that work as best it can. protected override bool GoToStateCore(Control control, FrameworkElement templateRoot, string stateName, Windows.UI.Xaml.VisualStateGroup @group, Windows.UI.Xaml.VisualState state, bool useTransitions) { // If this custom VSM is in play, it's because the control is using the Forms VSM or the user has disabled // legacy color handling. Either way, we may need to prevent the Windows VSM from transitioning to the new // state. So we intercept the transition here. if (ShouldIntercept(control, state, stateName)) { return(false); } return(base.GoToStateCore(control, templateRoot, stateName, @group, state, useTransitions)); }
public static void SetHide(Windows.UI.Xaml.VisualState state, string value) { state.SetValue(HideProperty, value); }
public static string GetHide(Windows.UI.Xaml.VisualState state) { return((string)state.GetValue(HideProperty)); }
public static void SetShow(Windows.UI.Xaml.VisualState state, string value) { state.SetValue(ShowProperty, value); }
internal void GoToState(IFrameworkElement element, VisualState state, VisualState originalState, bool useTransitions, Action onStateChanged) { if (this.Log().IsEnabled(Microsoft.Extensions.Logging.LogLevel.Debug)) { this.Log().DebugFormat("Go to state [{0}/{1}] on [{2}]", Name, state?.Name, element); } var transition = FindTransition(originalState?.Name, state?.Name); EventHandler <object> onComplete = null; onComplete = (s, a) => { onStateChanged(); if (state?.Storyboard == null) { return; } state.Storyboard.Completed -= onComplete; }; EventHandler <object> onTransitionComplete = null; onTransitionComplete = (s, a) => { if (transition?.Storyboard != null && useTransitions) { transition.Storyboard.Completed -= onTransitionComplete; if (state?.Storyboard != null) { transition.Storyboard.TurnOverAnimationsTo(state.Storyboard); } } //Starts Storyboard Animation if (state?.Storyboard == null) { onComplete(this, null); } else if (state != null) { state.Storyboard.Completed += onComplete; state.Storyboard.Begin(); } }; //Stops Previous Storyboard Animation if (originalState != null) { if (originalState.Storyboard != null) { if (transition?.Storyboard != null) { originalState.Storyboard.TurnOverAnimationsTo(transition.Storyboard); } else if (state?.Storyboard != null) { originalState.Storyboard.TurnOverAnimationsTo(state.Storyboard); } else { originalState.Storyboard.Stop(); } } foreach (var setter in this.CurrentState.Setters.OfType <Setter>()) { setter.ClearValue(); } } this.CurrentState = state; if (this.CurrentState != null) { foreach (var setter in this.CurrentState.Setters.OfType <Setter>()) { setter.ApplyValue(DependencyPropertyValuePrecedences.Animations, element); } } if (transition?.Storyboard == null || !useTransitions) { onTransitionComplete(this, null); } else { transition.Storyboard.Completed += onTransitionComplete; transition.Storyboard.Begin(); } }
protected virtual bool GoToStateCore(Control control, FrameworkElement templateRoot, string stateName, VisualStateGroup group, VisualState state, bool useTransitions) => GoToStateCorePrivateBaseImplementation(control, group, state, useTransitions);
protected virtual void RaiseCurrentStateChanged(VisualStateGroup stateGroup, VisualState oldState, VisualState newState) { if (stateGroup == null) { return; } stateGroup.RaiseCurrentStateChanged(oldState, newState); }
protected virtual bool GoToStateCore(Control control, IFrameworkElement templateRoot, string stateName, VisualStateGroup group, VisualState state, bool useTransitions) { #if IS_UNO if (_trace.IsEnabled) { _trace.WriteEvent( TraceProvider.StoryBoard_GoToState, EventOpcode.Send, new[] { control.GetType()?.ToString(), control?.GetDependencyObjectId().ToString(), stateName, useTransitions ? "UseTransitions" : "NoTransitions" } ); } #endif var originalState = group.CurrentState; if (VisualState.Equals(originalState, state)) { // Already in the right state return(true); } RaiseCurrentStateChanging(group, originalState, state); // The visual state group must not keep a hard reference to the control, // otherwise it may leak. var wr = Uno.UI.DataBinding.WeakReferencePool.RentWeakReference(this, control); group.GoToState( control, state, originalState, useTransitions, () => { var innerControl = wr?.Target as Control; if (innerControl != null) { RaiseCurrentStateChanged(group, originalState, state); } } ); return(true); }
protected override bool GoToStateCore(Control control, FrameworkElement templateRoot, string stateName, VisualStateGroup group, Windows.UI.Xaml.VisualState state, bool useTransitions) { return(base.GoToStateCore(control ?? new ContentControl(), templateRoot, stateName, group, state, useTransitions)); }
public static string GetShow(Windows.UI.Xaml.VisualState state) { return((string)state.GetValue(ShowProperty)); }