本文整理汇总了C#中TransitionCollection类的典型用法代码示例。如果您正苦于以下问题:C# TransitionCollection类的具体用法?C# TransitionCollection怎么用?C# TransitionCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TransitionCollection类属于命名空间,在下文中一共展示了TransitionCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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 (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
Frame 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 = 1;
// Set the default language
rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
Xamarin.Forms.Forms.Init(e);
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)
{
this.transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
this.transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += this.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(MainPage), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
// Ensure the current window is active
Window.Current.Activate();
}
示例2: 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();
}
示例3: OnLaunched
protected override async void OnLaunched(LaunchActivatedEventArgs e)
{
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
Frame rootFrame = Window.Current.Content as Frame;
if (rootFrame == null)
{
rootFrame = new Frame();
rootFrame.CacheSize = 1;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
}
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
//Step Two: Registering VCD file.
try
{
Uri uri = new Uri("ms-appx:///VoiceCommandDefinition1.xml");
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(uri);
await VoiceCommandManager.InstallCommandSetsFromStorageFileAsync(file);
App.InstallationMessage = "Installation Successfull";
}
catch(Exception ex)
{
//new MessageDialog(ex.Message).ShowAsync();
App.InstallationMessage = ex.Message;
}
if (rootFrame.ContentTransitions != null)
{
this.transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
this.transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += this.RootFrame_FirstNavigated;
if (!rootFrame.Navigate(typeof(MainPage), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
Window.Current.Activate();
}
示例4: 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)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
Frame 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)
{
// Frame erstellen, der als Navigationskontext fungiert und zum Parameter der ersten Seite navigieren
rootFrame = new Frame();
// TODO: diesen Wert auf eine Cachegröße ändern, die für Ihre Anwendung geeignet ist
rootFrame.CacheSize = 1;
// Standardsprache festlegen
rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
// TODO: Zustand von zuvor angehaltener Anwendung laden
}
// Den Frame im aktuellen Fenster platzieren
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
// Entfernt die Drehkreuznavigation für den Start.
if (rootFrame.ContentTransitions != null)
{
this.transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
this.transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += this.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();
}
示例5: 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 (System.Diagnostics.Debugger.IsAttached)
// {
// this.DebugSettings.EnableFrameRateCounter = true;
// }
//#endif
var appShell = Window.Current.Content as AppShell;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (appShell == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
appShell = new AppShell();
appShell.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 = appShell;
}
if (appShell.CurrentContent == null)
{
#if WINDOWS_PHONE_APP
// Removes the turnstile navigation for startup.
if (rootFrame.ContentTransitions != null)
{
this.transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
this.transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += this.RootFrame_FirstNavigated;
#endif
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
var nvi = AppPages.MenuItem<MainMenuPage>();
AppVm.Current.Navigate(nvi);
//if (!appShell.AppFrame.Navigate(typeof(NewSimPage), e.Arguments))
//{
// throw new Exception("Failed to create initial page");
//}
}
// Ensure the current window is active
Window.Current.Activate();
}
示例6: OnLaunched
/// <summary>
/// Invoqué lorsque l'application est lancée normalement par l'utilisateur final. D'autres points d'entrée
/// sont utilisés lorsque l'application est lancée pour ouvrir un fichier spécifique, pour afficher
/// des résultats de recherche, etc.
/// </summary>
/// <param name="e">Détails concernant la requête et le processus de lancement.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
Frame rootFrame = Window.Current.Content as Frame;
// Ne répétez pas l'initialisation de l'application lorsque la fenêtre comporte déjà du contenu,
// assurez-vous juste que la fenêtre est active
if (rootFrame == null)
{
// Créez un Frame utilisable comme contexte de navigation et naviguez jusqu'à la première page
rootFrame = new Frame();
// TODO: modifier cette valeur à une taille de cache qui contient à votre application
rootFrame.CacheSize = 1;
// Définir la page par défaut
rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
// TODO: chargez l'état de l'application précédemment suspendue
}
// Placez le frame dans la fenêtre active
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
// Supprime la navigation tourniquet pour le démarrage.
if (rootFrame.ContentTransitions != null)
{
this.transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
this.transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += this.RootFrame_FirstNavigated;
// Quand la pile de navigation n'est pas restaurée, accédez à la première page,
// puis configurez la nouvelle page en transmettant les informations requises en tant que
// paramètre
if (!rootFrame.Navigate(typeof(MainPage), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
// Vérifiez que la fenêtre actuelle est active
Window.Current.Activate();
}
示例7: OnLaunched
/// <summary>
/// アプリケーションがエンド ユーザーによって正常に起動されたときに呼び出されます。他のエントリ ポイントは、
/// アプリケーションが特定のファイルを開くために呼び出されたときに
/// 検索結果やその他の情報を表示するために使用されます。
/// </summary>
/// <param name="e">起動要求とプロセスの詳細を表示します。</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
Frame rootFrame = Window.Current.Content as Frame;
// ウィンドウに既にコンテンツが表示されている場合は、アプリケーションの初期化を繰り返さずに、
// ウィンドウがアクティブであることだけを確認してください
if (rootFrame == null)
{
// ナビゲーション コンテキストとして動作するフレームを作成し、最初のページに移動します
rootFrame = new Frame();
// TODO: この値をアプリケーションに適切なキャッシュ サイズに変更します
rootFrame.CacheSize = 1;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: 以前中断したアプリケーションから状態を読み込みます。
}
// フレームを現在のウィンドウに配置します
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
#if WINDOWS_PHONE_APP
// スタートアップのターンスタイル ナビゲーションを削除します。
if (rootFrame.ContentTransitions != null)
{
this.transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
this.transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += this.RootFrame_FirstNavigated;
#endif
// ナビゲーションの履歴スタックが復元されていない場合、最初のページに移動します。
// このとき、必要な情報をナビゲーション パラメーターとして渡して、新しいページを
// 作成します
if (!rootFrame.Navigate(typeof(MainPage), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
// 現在のウィンドウがアクティブであることを確認します
Window.Current.Activate();
}
示例8: OnLaunched
/// <summary>
/// Wywoływane, gdy aplikacja jest uruchamiana normalnie przez użytkownika końcowego. Inne punkty wejścia
/// będą używane, kiedy aplikacja zostanie uruchomiona, aby otworzyć określony plik, wyświetlić
/// wyniki wyszukiwania itd.
/// </summary>
/// <param name="e">Szczegóły dotyczące żądania uruchomienia i procesu.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
Frame rootFrame = Window.Current.Content as Frame;
// Nie powtarzaj inicjowania aplikacji, gdy w oknie znajduje się już zawartość,
// upewnij się tylko, że okno jest aktywne
if (rootFrame == null)
{
// Utwórz ramkę, która będzie pełnić funkcję kontekstu nawigacji, i przejdź do pierwszej strony
rootFrame = new Frame();
// TODO: zmień tę wartość na rozmiar pamięci podręcznej odpowiedni dla Twojej aplikacji
rootFrame.CacheSize = 1;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
// TODO: Wczytaj stan z wstrzymanej wcześniej aplikacji
}
// Umieść ramkę w bieżącym oknie
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
#if WINDOWS_PHONE_APP
// Usuwa nawigację turnstile dla uruchomienia.
if (rootFrame.ContentTransitions != null)
{
this.transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
this.transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += this.RootFrame_FirstNavigated;
#endif
// Kiedy stos nawigacji nie jest przywrócony, przejdź do pierwszej strony,
// konfigurując nową stronę przez przekazanie wymaganych informacji jako
// parametr nawigacji
if (!rootFrame.Navigate(typeof(MainPage), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
// Upewnij się, ze bieżące okno jest aktywne
Window.Current.Activate();
}
示例9: 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();
}
示例10: OnLaunched
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Debug.WriteLine("[CICLO] Aplicação Sendo Lançada");
/*
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
*/
Frame 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 = 1;
// 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)
{
this.transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
this.transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += this.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(MainPage), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
// Ensure the current window is active
Window.Current.Activate();
}
示例11: PageBase
public PageBase()
{
Transitions = new TransitionCollection();
var theme = new NavigationThemeTransition
{
DefaultNavigationTransitionInfo = new SlideNavigationTransitionInfo()
};
Transitions.Add(theme);
}
示例12: 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 (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
Frame 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 = 1;
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)
{
#if WINDOWS_PHONE_APP
// Removes the turnstile navigation for startup.
if (rootFrame.ContentTransitions != null)
{
this.transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
this.transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += this.RootFrame_FirstNavigated;
#endif
var setup = new Setup(rootFrame);
setup.Initialize();
var start = Mvx.Resolve<IMvxAppStart>();
start.Start();
}
// Ensure the current window is active
Window.Current.Activate();
}
示例13: 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)
{
Current.Resources["PhoneAccentBrush"] = Current.Resources["FC.Brush.Accent"];
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
Frame 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();
// 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)
{
this.transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
this.transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += this.RootFrame_FirstNavigated;
AppSettings appSettings = new AppSettings();
appSettings.LaunchedCount += 1;
// 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(DashboardView), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
// Ensure the current window is active.
Window.Current.Activate();
DispatcherHelper.Initialize();
}
示例14: ProcessTransitions
/// <summary>
/// Processes the new <paramref name="transitions" /> discovered by the <paramref name="worker " /> within the traversal
/// <paramref name="context" />. Only transitions with <see cref="CandidateTransition.IsValid" /> set to <c>true</c> are
/// actually new.
/// </summary>
/// <param name="context">The context of the model traversal.</param>
/// <param name="worker">The worker that found the transition.</param>
/// <param name="sourceState">The index of the transition's source state.</param>
/// <param name="transitions">The new transitions that should be processed.</param>
/// <param name="transitionCount">The actual number of valid transitions.</param>
/// <param name="areInitialTransitions">
/// Indicates whether the transitions are an initial transitions not starting in any valid source state.
/// </param>
public void ProcessTransitions(TraversalContext context, Worker worker, int sourceState, TransitionCollection transitions,
int transitionCount, bool areInitialTransitions)
{
if (transitionCount == 0)
{
throw new InvalidOperationException(
"Deadlock state detected, i.e., there are no outgoing transitions for " +
"the last state in the generated counter example. Try relaxing state constraints.");
}
}
示例15: 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();
}