本文整理汇总了C#中Windows.UI.Xaml.Controls.Primitives.Popup类的典型用法代码示例。如果您正苦于以下问题:C# Popup类的具体用法?C# Popup怎么用?C# Popup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Popup类属于Windows.UI.Xaml.Controls.Primitives命名空间,在下文中一共展示了Popup类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnApplyTemplate
protected override void OnApplyTemplate()
{
base.OnApplyTemplate();
var deleteButton = GetTemplateChild("DeleteButton") as Button;
if (deleteButton != null)
deleteButton.Tapped += DeleteButton_Tapped;
if (DateComponents != null)
{
var monthColumn = GetTemplateChild("PART_DateColumn" + Array.IndexOf(DateComponents, month)) as ColumnDefinition;
if (monthColumn != null)
monthColumn.Width = new GridLength(1, GridUnitType.Star);
}
popup = GetTemplateChild("Popup") as Popup;
if (popup != null)
popup.Closed += (_, __) => Focus(FocusState.Programmatic);
VisualStateManager.GoToState(this, "Normal", false);
VisualStateManager.GoToState(this, "NoDate", true);
VisualStateManager.GoToState(this, "NoTime", true);
VisualStateManager.GoToState(this, "NoOffset", true);
VisualStateManager.GoToState(this, "NoAMPM", true);
}
开发者ID:stevehansen,项目名称:vidyano_v1,代码行数:25,代码来源:PersistentObjectAttributeDateTimeOffset.cs
示例2: BlankPage_CommandsRequested
void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
// 新建一个命令
SettingsCommand cmd = new SettingsCommand("login", "登录", (x) =>
{
// 新建一个Popup,并将其宽度设置为346,高度与屏幕一致
_settingsPopup = new Popup();
_settingsPopup.Width = 346;
_settingsPopup.Height = Window.Current.Bounds.Height;
_settingsPopup.IsLightDismissEnabled = true;
// 新建一个页面,并设置该页面的相关属性(大小,位置)
LoginPane mypane = new LoginPane();
mypane.Height = Window.Current.Bounds.Height;
mypane.Width = 346;
_settingsPopup.Child = mypane;
_settingsPopup.SetValue(Canvas.LeftProperty, Window.Current.Bounds.Width - 346);
_settingsPopup.IsOpen = true;
});
args.Request.ApplicationCommands.Add(cmd);
SettingsCommand cmd1 = new SettingsCommand("logout", "注销", (x) =>
{
});
args.Request.ApplicationCommands.Add(cmd1);
}
开发者ID:BeyondVincent,项目名称:WindowsStoreAppCode,代码行数:28,代码来源:MainPage.xaml.cs
示例3: ShowDialog
/// <summary>
/// Displays the dialog.
/// </summary>
public ConfiguredEndpoint ShowDialog(ApplicationConfiguration configuration, bool createNew)
{
m_configuration = configuration;
m_endpoint = null;
// create a default collection if none provided.
if (createNew)
{
ApplicationDescription server = new DiscoveredServerListDlg().ShowDialog(null, m_configuration);
if (server != null)
{
return new ConfiguredEndpoint(server, EndpointConfiguration.Create(configuration));
}
return null;
}
ServersCTRL.Initialize(null, configuration);
OkBTN.IsEnabled = false;
Popup myPopup = new Popup();
myPopup.Child = this;
myPopup.IsOpen = true;
return m_endpoint;
}
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:31,代码来源:ConfiguredServerListDlg.xaml.cs
示例4: OpenLoginPopUp
private void OpenLoginPopUp(bool open)
{
if (!open)
{
if (loginPopUp != null)
loginPopUp.IsOpen = false;
return;
}
var windowBounds = Window.Current.Bounds;
loginPopUp = new Popup()
{
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
Width = 500,
Height = 310,
IsLightDismissEnabled = false,
IsOpen = true
};
loginPopUp.Child = new LoginView();
loginPopUp.SetValue(Popup.HorizontalOffsetProperty, 600);
loginPopUp.SetValue(Popup.VerticalOffsetProperty, 300);
loginPopUp.Closed += _loginPopup_Closed;
}
开发者ID:sharemepoint,项目名称:SharePointAuthentication,代码行数:29,代码来源:MainView.xaml.cs
示例5: AlphabetSoundGridView_ItemClick
private void AlphabetSoundGridView_ItemClick(object sender, ItemClickEventArgs e)
{
var sound = (Sound)e.ClickedItem;
MyMediaElement.Source = new Uri(this.BaseUri, sound.AudioFile); //playing the sound
// var dialog = new MessageDialog(sound.AudioFile.ToString());
String lett = sound.Name.ToString();
//String lett = sound.AudioFile.ToString().Substring(0,sound.a)
//await dialog2.ShowAsync();
//var user = myTextBox.ToString();
Popup popup = new Popup();
popup.MaxHeight = 2000;
popup.MaxWidth = 2000;
//popup.VerticalOffset = 100;
PopUpPage control = new PopUpPage(lett);
popup.Child = control;
popup.IsOpen = true;
}
开发者ID:sarbjeetkumar,项目名称:MoblieAppProject,代码行数:31,代码来源:GamePage.xaml.cs
示例6: MoviePlayer
public MoviePlayer(ref Popup Popup)
{
this.popup = Popup;
this.InitializeComponent();
string youTubeId = "VXPoJAyeF8k";
TestImage.Source = image;
TestImage.Height = 500;
TestImage.Width = 340;
var url = YouTube.GetVideoUriAsync(youTubeId);
var url2 = YouTube.GetVideoUri(youTubeId, YouTubeQuality.Quality1080P, null);
MovieContainer.Source = url.Result.Uri;
MovieContainer.Play();
MovieContainer.Width = baseMovieWidth;
MovieContainer.Height = baseMovieHeight;
LikeActive = new SolidColorBrush();
LikeActive.Color = Colors.ForestGreen;
LikeInactive = new SolidColorBrush();
LikeInactive.Color = Colors.White;
DislikeActive = new SolidColorBrush();
DislikeActive.Color = Colors.Red;
DislikeInactive = new SolidColorBrush();
DislikeInactive.Color = Colors.White;
}
开发者ID:alexsb92,项目名称:TheMovieTrailerApp,代码行数:28,代码来源:MoviePlayer.xaml.cs
示例7: AddAlbumAsync
public static async Task<AddAlbumResult> AddAlbumAsync()
{
var tcs = new TaskCompletionSource<int>();
var result = new AddAlbumResult();
var p = new Popup
{
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Stretch,
Width = Window.Current.Bounds.Width,
Height = Window.Current.Bounds.Height
};
var f = new AddAlbumView
{
Width = Window.Current.Bounds.Width,
Height = Window.Current.Bounds.Height,
Cancelled = () =>
{
tcs.TrySetResult(1);
p.IsOpen = false;
},
Result = a =>
{
result = new AddAlbumResult { AlbumName = a };
p.IsOpen = false;
tcs.TrySetResult(1);
}
};
p.Child = f;
p.IsOpen = true;
await tcs.Task;
return result;
}
开发者ID:willhughes,项目名称:Smuggle,代码行数:34,代码来源:AddAlbumView.xaml.cs
示例8: Initialize
/// <summary>
/// Initialize VideoPlayer.
/// </summary>
private static void Initialize(VideoStretch stretch)
{
#if NETFX_CORE
if (_videoPopup == null)
{
_videoPopup = new Popup();
}
_videoPopup.VerticalOffset = 0;
_videoPopup.HorizontalOffset = 0;
if (_videoElement == null)
{
_videoElement = new MediaElement();
}
_videoPopup.Child = _videoElement;
_videoElement.MediaEnded += _videoElement_MediaEnded;
_videoElement.MediaOpened += _videoElement_MediaOpened;
_videoPopup.Height = Window.Current.Bounds.Height;
_videoPopup.Width = Window.Current.Bounds.Width;
_videoElement.Tapped += _videoElement_Tapped;
_videoElement.Stretch = (Stretch)stretch;
_videoElement.AutoPlay = false;
_videoElement.Height = _videoPopup.Height;
_videoElement.Width = _videoPopup.Width;
_videoPopup.IsOpen = true;
#endif
}
开发者ID:khaerul10056,项目名称:MarkerMetro.Unity.WinIntegration,代码行数:37,代码来源:VideoPlayer.cs
示例9: OnAboutCommand
private void OnAboutCommand(IUICommand command)
{
SettingsPopup = new Popup();
SettingsPopup.IsLightDismissEnabled = true;
SettingsPopup.Width = SettingsWidth;
SettingsPopup.Height = WindowBounds.Height;
SettingsPopup.ChildTransitions = new TransitionCollection
{
new PaneThemeTransition
{
Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right)
? EdgeTransitionLocation.Right
: EdgeTransitionLocation.Left
}
};
var mypane = new AboutFlyout { Width = SettingsWidth, Height = WindowBounds.Height };
SettingsPopup.Child = mypane;
SettingsPopup.SetValue(Canvas.LeftProperty,
SettingsPane.Edge == SettingsEdgeLocation.Right
? (WindowBounds.Width - SettingsWidth)
: 0);
SettingsPopup.SetValue(Canvas.TopProperty, 0);
SettingsPopup.IsOpen = true;
}
开发者ID:rousse101,项目名称:WritePadSDK,代码行数:28,代码来源:SettingsUI.cs
示例10: ShowInPopup
public void ShowInPopup(double? width = null, double? height = null)
{
var popup = new Popup();
if (width.HasValue)
{
popup.Width = width.Value;
this.Width = width.Value;
}
if (height.HasValue)
{
popup.Height = height.Value;
this.Height = height.Value;
}
this._parentPopup = popup;
popup.Child = this;
popup.IsOpen = true;
_currentlyShownInstances.Add(this);
this.PrepareForLoad();
}
开发者ID:super-ala,项目名称:vk-windowsphone-sdk,代码行数:25,代码来源:VKPopupControlBase.cs
示例11: OnWrapOptionsAppBarButtonClick
void OnWrapOptionsAppBarButtonClick(object sender, RoutedEventArgs args)
{
// Create dialog
WrapOptionsDialog wrapOptionsDialog = new WrapOptionsDialog
{
TextWrapping = txtbox.TextWrapping
};
// Bind dialog to TextBox
Binding binding = new Binding
{
Source = wrapOptionsDialog,
Path = new PropertyPath("TextWrapping"),
Mode = BindingMode.TwoWay
};
txtbox.SetBinding(TextBox.TextWrappingProperty, binding);
// Create popup
Popup popup = new Popup
{
Child = wrapOptionsDialog,
IsLightDismissEnabled = true
};
// Adjust location based on content size
wrapOptionsDialog.SizeChanged += (dialogSender, dialogArgs) =>
{
popup.VerticalOffset = this.ActualHeight - wrapOptionsDialog.ActualHeight
- this.BottomAppBar.ActualHeight - 48;
popup.HorizontalOffset = 48;
};
// Open the popup
popup.IsOpen = true;
}
开发者ID:BeyondVincent,项目名称:WindowsStoreAppStepByStep,代码行数:35,代码来源:MainPage.xaml.cs
示例12: ShowAsync
public static async Task ShowAsync(this IDialog view)
{
var tcs = new TaskCompletionSource<int>();
var p = new Popup
{
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Stretch,
Width = Window.Current.Bounds.Width,
Height = Window.Current.Bounds.Height
};
((UserControl)view).Width = Window.Current.Bounds.Width;
((UserControl)view).Height = Window.Current.Bounds.Height;
view.Cancelled += () =>
{
tcs.TrySetResult(1);
p.IsOpen = false;
};
p.Child = (UserControl)view;
p.IsOpen = true;
await tcs.Task;
return;
}
开发者ID:modulexcite,项目名称:MarkPadRT,代码行数:25,代码来源:InputDialog.cs
示例13: OnSettingsCommandInvoker
private void OnSettingsCommandInvoker(IUICommand command)
{
settingsPopup = new Popup();
settingsPopup.Closed += SettingsPopupOnClosed;
Window.Current.Activated += OnWindowActivated;
settingsPopup.IsLightDismissEnabled = true;
settingsPopup.Width = settingsWidth;
settingsPopup.Height = windowBounds.Height;
settingsPopup.ChildTransitions = new TransitionCollection();
settingsPopup.ChildTransitions.Add(new PaneThemeTransition()
{
Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right) ?
EdgeTransitionLocation.Right :
EdgeTransitionLocation.Left
});
// Create a SettingsFlyout the same dimenssions as the Popup.
var mypane = new SettingsFlyoutPage
{
DataContext = this.Settings
};
mypane.Width = settingsWidth;
mypane.Height = windowBounds.Height;
settingsPopup.Child = mypane;
settingsPopup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (windowBounds.Width - settingsWidth) : 0);
settingsPopup.SetValue(Canvas.TopProperty, 0);
settingsPopup.IsOpen = true;
}
开发者ID:derikwhittaker,项目名称:LiveLessons.WinRT,代码行数:32,代码来源:DashboardViewModel.cs
示例14: OnPopupClosed
private void OnPopupClosed(object sender, object e)
{
if (_tcs != null && !_tcs.Task.IsCompleted)
_tcs.SetException(new OperationCanceledException()); // user closed the window
_tcs = null;
_popup = null;
}
开发者ID:MagicWang,项目名称:arcgis-runtime-samples-dotnet,代码行数:7,代码来源:OAuthAuthorizeHandler.cs
示例15: VerMetodoPagoPopup
public VerMetodoPagoPopup(Popup padre)
{
if (padre == null) throw new ArgumentNullException("Debe asignar un Popup al controlador");
this.popup = padre;
this.InitializeComponent();
cargarMetodoPago();
}
开发者ID:alonsonic,项目名称:Desarrollo,代码行数:7,代码来源:VerMetodoPagoPopup.xaml.cs
示例16: ShowDialog
/// <summary>
/// Prompts the user to specify the browse options.
/// </summary>
public async Task<bool> ShowDialog(Subscription subscription)
{
if (subscription == null) throw new ArgumentNullException("subscription");
DisplayNameTB.Text = subscription.DisplayName;
PublishingIntervalNC.Value = (double)Convert.ToDecimal(subscription.PublishingInterval);
KeepAliveCountNC.Value = subscription.KeepAliveCount;
LifetimeCountCTRL.Value = subscription.LifetimeCount;
MaxNotificationsCTRL.Value = subscription.MaxNotificationsPerPublish;
PriorityNC.Value = subscription.Priority;
PublishingEnabledCK.IsChecked = subscription.PublishingEnabled;
TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>();
Popup dialog = new Popup();
dialog.Child = this;
dialog.IsOpen = true;
dialog.Closed += (o, e) =>
{
tcs.SetResult(dialogResult);
};
bool result = await tcs.Task;
subscription.DisplayName = DisplayNameTB.Text;
subscription.PublishingInterval = (int)PublishingIntervalNC.Value;
subscription.KeepAliveCount = (uint)KeepAliveCountNC.Value;
subscription.LifetimeCount = (uint)LifetimeCountCTRL.Value;
subscription.MaxNotificationsPerPublish = (uint)MaxNotificationsCTRL.Value;
subscription.Priority = (byte)PriorityNC.Value;
subscription.PublishingEnabled = (bool)PublishingEnabledCK.IsChecked;
return result;
}
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:36,代码来源:SubscriptionEditDlg.xaml.cs
示例17: ShowFlyout
public void ShowFlyout(UserControl control, int width, bool isLightDismiss)
{
if (popup == null)
{
popup = new Popup();
popup.Closed += popup_Closed;
popup.ChildTransitions = new TransitionCollection();
popup.ChildTransitions.Add(new PaneThemeTransition()
{
Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right) ?
EdgeTransitionLocation.Right :
EdgeTransitionLocation.Left
});
}
Window.Current.Activated += Current_Activated;
popup.Width = width;
popup.Height = Window.Current.Bounds.Height;
popup.IsLightDismissEnabled = isLightDismiss;
control.Width = width;
control.Height = Window.Current.Bounds.Height;
popup.Child = control;
popup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (Window.Current.Bounds.Width - width) : 0);
popup.SetValue(Canvas.TopProperty, 0);
popup.IsOpen = true;
}
开发者ID:uvbs,项目名称:MyProjects,代码行数:29,代码来源:SettingsFlyout.cs
示例18: DireccionPopup
public DireccionPopup(Popup padre)
{
if (padre == null) throw new ArgumentNullException("Debe asignar un Popup al controlador");
this.popup = padre;
this.InitializeComponent();
cargarEstados();
}
开发者ID:alonsonic,项目名称:Desarrollo,代码行数:7,代码来源:DireccionPopup.xaml.cs.BASE.52.cs
示例19: CommandsRequested
void CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
var command = new SettingsCommand("settings", "Settings", (x) => {
this._settingsPopup = new Popup();
this._settingsPopup.Closed += this.SettingsPopupClosed;
this._settingsPopup.Opened += this.SettingsPopupOpened;
this._settingsPopup.IsLightDismissEnabled = true;
this._settingsPopup.Width = this._settingsWidth;
this._settingsPopup.Height = this._windowsBounds.Height;
var settingsPane = new ApplicationSettings();
settingsPane.Width = this._settingsWidth;
settingsPane.Height = this._windowsBounds.Height;
this._settingsPopup.Child = settingsPane;
this._settingsPopup.SetValue(Canvas.LeftProperty, this._windowsBounds.Width - this._settingsWidth);
this._settingsPopup.SetValue(Canvas.TopProperty, 0);
this._settingsPopup.IsOpen = true;
Window.Current.Activated += OnWindowActivated;
});
args.Request.ApplicationCommands.Add(command);
}
开发者ID:m-gagne,项目名称:MetroMarkdown,代码行数:25,代码来源:Editor.xaml.cs
示例20: ShowDialog
/// <summary>
/// Displays the dialog.
/// </summary>
public bool ShowDialog(UserNameIdentityToken token)
{
if (token != null)
{
UserNameCB.SelectedItem = token.UserName;
if (token.Password != null && token.Password.Length > 0)
{
PasswordTB.Password = new UTF8Encoding().GetString(token.Password);
}
}
Popup myPopup = new Popup();
myPopup.Child = this;
myPopup.IsOpen = true;
token.UserName = UserNameCB.SelectedItem.ToString();
if (!String.IsNullOrEmpty(PasswordTB.Password))
{
token.Password = new UTF8Encoding().GetBytes(PasswordTB.Password);
}
else
{
token.Password = null;
}
return true;
}
开发者ID:yuriik83,项目名称:UA-.UWP-Universal-Windows-Platform,代码行数:32,代码来源:UsernameTokenDlg.xaml.cs
注:本文中的Windows.UI.Xaml.Controls.Primitives.Popup类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论