本文整理汇总了C#中TransitionCollection.Add方法的典型用法代码示例。如果您正苦于以下问题:C# TransitionCollection.Add方法的具体用法?C# TransitionCollection.Add怎么用?C# TransitionCollection.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransitionCollection
的用法示例。
在下文中一共展示了TransitionCollection.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnLaunched
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
var rootFrame = GetOrCreateRootFrame();
if (rootFrame.Content == null)
{
if (rootFrame.ContentTransitions != null)
{
transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += RootFrame_FirstNavigated;
if (!rootFrame.Navigate(typeof (MainPage), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
Window.Current.Activate();
}
示例2: OnLaunched
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used when the application is launched to open a specific file, to display
/// search results, and so forth.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
#if DEBUG
if (Debugger.IsAttached)
{
DebugSettings.EnableFrameRateCounter = true;
}
#endif
var rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
// TODO: change this value to a cache size that is appropriate for your application
rootFrame.CacheSize = 2;
// Set the default language
rootFrame.Language = ApplicationLanguages.Languages[0];
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
// TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
// Removes the turnstile navigation for startup.
if (rootFrame.ContentTransitions != null)
{
transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += RootFrame_FirstNavigated;
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
if (!rootFrame.Navigate(typeof (SearchPage), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
// Ensure the current window is active
Window.Current.Activate();
}
示例3: OnLaunched
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
#if WINDOWS_PHONE_APP
var applicationView = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();
applicationView.VisibleBoundsChanged += ApplicationView_VisibleBoundsChanged;
applicationView.SetDesiredBoundsMode(Windows.UI.ViewManagement.ApplicationViewBoundsMode.UseCoreWindow);
#endif
Frame rootFrame = Window.Current.Content as Frame;
if (rootFrame == null)
{
rootFrame = new Frame();
rootFrame.CacheSize = 1;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
// TODO: Load state from previously suspended application
}
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
#if WINDOWS_PHONE_APP
if (rootFrame.ContentTransitions != null)
{
transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
transitions.Add(c);
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += RootFrame_FirstNavigated;
#endif
ParticleCloud.SharedCloud.SynchronizationContext = System.Threading.SynchronizationContext.Current;
Type firstPage = null;
string accessToken = TinkerData.AccessToken;
if (!String.IsNullOrWhiteSpace(accessToken))
{
ParticleCloud.SharedCloud.SetAuthentication(accessToken);
firstPage = typeof(DevicesPage);
}
else
{
firstPage = typeof(GetStartedPage);
}
if (!rootFrame.Navigate(firstPage, e.Arguments))
throw new Exception("Failed to create initial page");
TinkerData.SetApplcationFrame(rootFrame);
}
Window.Current.Activate();
}
示例4: PageBase
public PageBase()
{
Transitions = new TransitionCollection();
#if WINDOWS_PHONE_APP
var theme = new NavigationThemeTransition
{
DefaultNavigationTransitionInfo = new SlideNavigationTransitionInfo()
};
Transitions.Add(theme);
#else
var theme = new PopupThemeTransition()
{
FromVerticalOffset = -200
};
Transitions.Add(theme);
#endif
}
示例5: PageBase
public PageBase()
{
Transitions = new TransitionCollection();
var theme = new NavigationThemeTransition
{
DefaultNavigationTransitionInfo = new SlideNavigationTransitionInfo()
};
Transitions.Add(theme);
}
示例6: OnLaunched
/// <summary>
/// Wird aufgerufen, wenn die Anwendung durch den Endbenutzer normal gestartet wird. Weitere Einstiegspunkte
/// werden verwendet, wenn die Anwendung zum Öffnen einer bestimmten Datei, zum Anzeigen
/// von Suchergebnissen usw. gestartet wird.
/// </summary>
/// <param name="e">Details über Startanforderung und -prozess.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
DebugSettings.EnableFrameRateCounter = true;
}
#endif
var rootFrame = Window.Current.Content as Frame;
// App-Initialisierung nicht wiederholen, wenn das Fenster bereits Inhalte enthält.
// Nur sicherstellen, dass das Fenster aktiv ist.
if (rootFrame == null)
{
// Einen Rahmen erstellen, der als Navigationskontext fungiert und zum Parameter der ersten Seite navigieren
rootFrame = new Frame { CacheSize = 1 };
// TODO: diesen Wert auf eine Cachegröße ändern, die für Ihre Anwendung geeignet ist
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
// TODO: Zustand von zuvor angehaltener Anwendung laden
}
// Den Rahmen im aktuellen Fenster platzieren
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
// Entfernt die Drehkreuznavigation für den Start.
if (rootFrame.ContentTransitions != null)
{
transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += RootFrame_FirstNavigated;
// Wenn der Navigationsstapel nicht wiederhergestellt wird, zur ersten Seite navigieren
// und die neue Seite konfigurieren, indem die erforderlichen Informationen als Navigationsparameter
// übergeben werden
if (!rootFrame.Navigate(typeof(MainPage), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
// Sicherstellen, dass das aktuelle Fenster aktiv ist
Window.Current.Activate();
}
示例7: OnLaunched
protected async override void OnLaunched(LaunchActivatedEventArgs e)
{
#if DEBUG
if (Debugger.IsAttached)
{
DebugSettings.EnableFrameRateCounter = true;
}
#endif
var rootFrame = Window.Current.Content as Frame;
if (rootFrame == null)
{
rootFrame = new Frame { CacheSize = 1 };
SuspensionManager.RegisterFrame(rootFrame, "AppFrame");
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
try
{
await SuspensionManager.RestoreAsync();
}
catch (SuspensionManagerException)
{
Debug.Assert(false, "Error while restoring app state");
}
}
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
#if WINDOWS_PHONE_APP
if (rootFrame.ContentTransitions != null)
{
mTransistions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
mTransistions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += OnFirstNavigated;
#endif
if (!rootFrame.Navigate(typeof(HubPage), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
Window.Current.Activate();
}
示例8: SetUpPageAnimation
public void SetUpPageAnimation()
{
TransitionCollection collection = new TransitionCollection();
NavigationThemeTransition theme = new NavigationThemeTransition();
var info = new ContinuumNavigationTransitionInfo();
theme.DefaultNavigationTransitionInfo = info;
collection.Add(theme);
this.Transitions = collection;
}
示例9: NavigationFacade
public NavigationFacade(Frame frame)
{
_frame = frame;
// setup animations
var c = new TransitionCollection();
var t = new NavigationThemeTransition();
//var i = new EntranceNavigationTransitionInfo();
//t.DefaultNavigationTransitionInfo = i;
c.Add(t);
_frame.ContentTransitions = c;
}
示例10: FrameFacade
public FrameFacade(Frame frame)
{
_frame = frame;
_navigatedEventHandlers = new List<EventHandler<NavigatedEventArgs>>();
// setup animations
var c = new TransitionCollection { };
var t = new NavigationThemeTransition { };
var i = new EntranceNavigationTransitionInfo();
t.DefaultNavigationTransitionInfo = i;
c.Add(t);
_frame.ContentTransitions = c;
}
示例11: MainPage
public MainPage()
{
this.InitializeComponent();
this.RegisterPropertyChangedCallback(ViewModelProperty, (_, __) =>
{
StrongTypeViewModel = this.ViewModel as MainPage_Model;
});
StrongTypeViewModel = this.ViewModel as MainPage_Model;
var transitions = new TransitionCollection();
var transition = new NavigationThemeTransition();
transitions.Add(transition);
VMFrame.ContentTransitions = transitions;
}
示例12: SetBackground
private async void SetBackground()
{
childList = new ZIndexList();
PixelmapImage image = new PixelmapImage(1, 1);
await image.SetSource(new Uri("ms-appx:///Assets/background.png"));
ImageBrush brush = new ImageBrush();
brush.ImageSource = await image.ToWriteableBitmapImage();
//Grid someGrid = new Grid() { Width = 100, Height = 100, HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Left, Background = brush, Name = "someGrid" };
//MainP.Children.Add(someGrid);
image = await image.StretchToFit(210, 210);
brush = new ImageBrush();
brush.ImageSource = await image.ToWriteableBitmapImage();
TPanel f = new TPanel() { Background = brush, HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Left, Height = 210, Margin = new Thickness(63, 291, 0, 0), VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top, Width = 210 };
f.Tapped += Button_Tapped;
childList.Add(f);
MainP.Children.Add(f);
TransitionCollection tc = new TransitionCollection();
tc.Add(new Windows.UI.Xaml.Media.Animation.AddDeleteThemeTransition());
//someGrid.RenderTransform = new CompositeTransform();
sb = new Storyboard();
DoubleAnimation da = new DoubleAnimation();
//Storyboard.SetTarget(da, someGrid);
Storyboard.SetTargetProperty(da, "(UIElement.RenderTransform).(CompositeTransform.TranslateX)");
da.From = 500;
da.To = 1000;
da.Duration = new Duration(new TimeSpan(0,0,0,0,100));
//da.AutoReverse = true;
da.Completed += (source, e) => { go = !go; (source as DoubleAnimation).To = go ? 500 : 1000; (source as DoubleAnimation).From = go ? 1000 : 500; if(go)sb.Begin(); };
sb.Children.Add(da);
for (int i = 0; i < 5; i++)
{
TPanel r = new TPanel() { Transitions = tc, Background = brush, HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Left, Height = 210, Margin = new Thickness((childList.Last() as TPanel).Margin.Left + elementDistance, 291, 0, 0), VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top, Width = 210 };
r.Tapped += Button_Tapped;
RotatedText ro = new RotatedText();
ro.text.Text = "Text " + i;
ro.text.Loaded += (source, e) => { (source as TextBlock).Margin = new Thickness(0, (source as TextBlock).ActualWidth + 5, 0, 0); };
r.Children.Add(ro);
childList.Add(r);
MainP.Children.Add(r);
}
}
示例13: FrameFacade
internal FrameFacade(Frame frame)
{
Frame = frame;
frame.Navigated += (s, e) => FacadeNavigatedEventHandler(s, e);
frame.Navigating += (s, e) => FacadeNavigatingCancelEventHandler(s, e);
// setup animations
var c = new TransitionCollection { };
var t = new NavigationThemeTransition { };
var i = new EntranceNavigationTransitionInfo();
t.DefaultNavigationTransitionInfo = i;
c.Add(t);
Frame.ContentTransitions = c;
}
示例14: OnLaunched
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override async void OnLaunched(LaunchActivatedEventArgs e)
{
ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(320, 320));
Common.SuspensionManager.KnownTypes.Add(typeof(string[]));
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
RootFrame = MainHamburgerBar.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (RootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
RootFrame = new Frame();
Common.SuspensionManager.RegisterFrame(RootFrame, "appFrame");
RootFrame.NavigationFailed += OnNavigationFailed;
TransitionCollection transitions = new TransitionCollection();
transitions.Add(new EntranceThemeTransition() { FromHorizontalOffset = 200 });
RootFrame.ContentTransitions = transitions;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
await Common.SuspensionManager.RestoreAsync();
}
// Place the frame in the current Window
MainHamburgerBar.Content = RootFrame;
}
if (RootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
RootFrame.Navigate(typeof(BusMapPage), "CurrentLocation");
//RootFrame.Navigate(typeof(RoutesPage));
}
// Ensure the current window is active
Window.Current.Content = MainHamburgerBar;
Window.Current.Activate();
SetTitleBar();
var opts = BandwidthManager.EffectiveBandwidthOptions;
}
示例15: MainPage
public MainPage()
{
TransitionCollection collection = new TransitionCollection();
NavigationThemeTransition theme = new NavigationThemeTransition();
var info = new ContinuumNavigationTransitionInfo();
theme.DefaultNavigationTransitionInfo = info;
collection.Add(theme);
this.Transitions = collection;
SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();
systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
this.InitializeComponent();
}