本文整理汇总了C#中ITransition.Begin方法的典型用法代码示例。如果您正苦于以下问题:C# ITransition.Begin方法的具体用法?C# ITransition.Begin怎么用?C# ITransition.Begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITransition
的用法示例。
在下文中一共展示了ITransition.Begin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PerformTransition
/// <summary>
/// Performs a transition when given the appropriate components,
/// includes calling the appropriate start event and ensuring opacity
/// on the content presenter.
/// </summary>
/// <param name="navigationTransition">The navigation transition.</param>
/// <param name="presenter">The content presenter.</param>
/// <param name="transition">The transition instance.</param>
private static void PerformTransition(NavigationTransition navigationTransition, ContentPresenter presenter, ITransition transition)
{
if (navigationTransition != null)
{
navigationTransition.OnBeginTransition();
}
if (presenter != null && presenter.Opacity != 1)
{
presenter.Opacity = 1;
}
if (transition != null)
{
transition.Begin();
}
}
示例2: TransitionNewElement
/// <summary>
/// Transitions the new <see cref="T:System.Windows.UIElement"/>.
/// </summary>
/// <param name="oldContentPresenter">The old <see cref="T:System.Windows.Controls.ContentPresenter"/>.</param>
/// <param name="newContentPresenter">The new <see cref="T:System.Windows.Controls.ContentPresenter"/>.</param>
/// <param name="transition">The <see cref="T:Microsoft.Phone.Controls.ITransition"/>.</param>
private static void TransitionNewElement(ContentPresenter oldContentPresenter, ContentPresenter newContentPresenter, ITransition transition)
{
oldContentPresenter.Visibility = Visibility.Collapsed;
oldContentPresenter.Content = null;
if (transition == null)
{
newContentPresenter.Opacity = 1;
}
else
{
if (transition.GetCurrentState() != ClockState.Stopped)
{
transition.Stop();
}
transition.Completed += delegate
{
transition.Stop();
};
newContentPresenter.Opacity = 1;
transition.Begin();
}
}
示例3: TransitionNewElement
/// <summary>
/// Transitions the new <see cref="T:System.Windows.UIElement"/>.
/// </summary>
/// <param name="newTransition">The <see cref="T:Microsoft.Phone.Controls.ITransition"/> for the new <see cref="T:System.Windows.UIElement"/>.</param>
/// <param name="navigationInTransition">The <see cref="T:Microsoft.Phone.Controls.NavigationInTransition"/> for the new <see cref="T:System.Windows.UIElement"/>.</param>
private void TransitionNewElement(ITransition newTransition, NavigationInTransition navigationInTransition)
{
_oldContentPresenter.Visibility = Visibility.Collapsed;
_oldContentPresenter.Content = null;
if (newTransition == null)
{
_newContentPresenter.IsHitTestVisible = true;
_newContentPresenter.Opacity = 1;
return;
}
if (newTransition.GetCurrentState() != ClockState.Stopped)
{
newTransition.Stop();
}
newTransition.Completed += delegate
{
newTransition.Stop();
_newContentPresenter.CacheMode = null;
_newContentPresenter.IsHitTestVisible = true;
if (navigationInTransition != null)
{
navigationInTransition.OnEndTransition();
}
};
Dispatcher.BeginInvoke(delegate
{
if (navigationInTransition != null)
{
navigationInTransition.OnBeginTransition();
}
_newContentPresenter.Opacity = 1;
newTransition.Begin();
});
}
示例4: LoadData
/// <summary>
/// Load either from the cache on internet
/// </summary>
private void LoadData(int numberOfStarts, ITransition transition = null)
{
IndicateStartedLoading(numberOfStarts);
var loadContext = new DayLoadContext(CurrentDateForWiki, AppSettings.ShowNewestItemsFirst);
this.DataContext = DataManager.Current.Load<DayViewModel>(
loadContext,
vm =>
{
if (App.ReloadRequired)
{
App.ReloadRequired = false;
}
else if (App.FontSizeChanged)
{
vm.UpdateLayout();
App.FontSizeChanged = false;
}
if (App.ReverseRequired)
{
vm.Highlights = new ObservableCollection<Entry>(vm.Highlights.Reverse());
vm.Events.Events = new ObservableCollection<GroupedEntries>(vm.Events.Events.Reverse());
vm.Births.Births = new ObservableCollection<GroupedEntries>(vm.Births.Births.Reverse());
vm.Deaths.Deaths = new ObservableCollection<GroupedEntries>(vm.Deaths.Deaths.Reverse());
App.ReverseRequired = false;
}
if (!App.IsMemoryLimited && App.FirstLoad)
{
SetUpLiveTile(numberOfStarts);
}
if (App.IsMemoryLimited)
{
((ApplicationBarMenuItem)ApplicationBar.MenuItems[3]).IsEnabled = false;
}
IndicateStoppedLoading();
if (!inTransition && transition != null)
{
inTransition = true;
transition.Begin();
}
AdPanel.Opacity = 100;
},
ex =>
{
GlobalLoading.Instance.IsLoading = false;
GlobalLoading.Instance.LoadingText = null;
if (NetworkInterface.GetIsNetworkAvailable())
{
var extraData = new Collection<CrashExtraData>
{
new CrashExtraData { Key = "Date", Value = CurrentDateForWiki }
};
BugSenseHandler.Instance.SendExceptionMap(ex, extraData);
}
else
{
MessageBox.Show(Strings.ErrorInternetConnection);
}
if (!inTransition && transition != null)
{
inTransition = true;
transition.Begin();
}
});
SetPivotTitle();
}