本文整理汇总了C#中IUICommand类的典型用法代码示例。如果您正苦于以下问题:C# IUICommand类的具体用法?C# IUICommand怎么用?C# IUICommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IUICommand类属于命名空间,在下文中一共展示了IUICommand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConnectToServiceAsync
private async Task ConnectToServiceAsync(IUICommand command)
{
DeviceInformation serviceInfo = (DeviceInformation)command.Id;
this.State = BluetoothConnectionState.Connecting;
try
{
// Initialize the target Bluetooth RFCOMM device service
connectService = RfcommDeviceService.FromIdAsync(serviceInfo.Id);
rfcommService = await connectService;
if (rfcommService != null)
{
// Create a socket and connect to the target
socket = new StreamSocket();
connectAction = socket.ConnectAsync(rfcommService.ConnectionHostName, rfcommService.ConnectionServiceName, SocketProtectionLevel.BluetoothEncryptionAllowNullAuthentication);
await connectAction;//to make it cancellable
writer = new DataWriter(socket.OutputStream);
reader = new DataReader(socket.InputStream);
Task listen = ListenForMessagesAsync();
this.State = BluetoothConnectionState.Connected;
}
else
OnExceptionOccuredEvent(this, new Exception("Unable to create service.\nMake sure that the 'bluetooth.rfcomm' capability is declared with a function of type 'name:serialPort' in Package.appxmanifest."));
}
catch (TaskCanceledException)
{
this.State = BluetoothConnectionState.Disconnected;
}
catch (Exception ex)
{
this.State = BluetoothConnectionState.Disconnected;
OnExceptionOccuredEvent(this, ex);
}
}
示例2: YesBtnClick
private void YesBtnClick(IUICommand command)
{
Code c = new Code();
c.CPRStartTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, int.Parse(txtHour.Text), int.Parse(txtMinute.Text), 0);
this.Frame.Navigate(typeof(HomePage), c);
}
示例3: startTutorial
private static void startTutorial(IUICommand command)
{
//if (mapView.Frame != null)
//{
// mapView.Frame.Navigate(typeof(View.TutorialView));
//}
}
示例4: OnSetGameType
private void OnSetGameType(IUICommand command)
{
if (command.Label.Equals("Two player"))
playerX.IsPerson = true;
else
playerX.IsPerson = false;
}
示例5: 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;
}
示例6: onSettingsCommand
void onSettingsCommand(IUICommand command)
{
// TODO 2.3: execute the corresponding setting
// --> usually based on the SettingsCommand.Id value
SettingsCommand settingsCommand = (SettingsCommand)command;
rootPage.NotifyUser("You selected the " + settingsCommand.Label + " settings command", NotifyType.StatusMessage);
}
示例7: Save_Popup_Yes
private async void Save_Popup_Yes(IUICommand command)
{
var viewModel = DataContext as CreateOrderPageViewModel;
Tuple<bool,string> answer = viewModel.SaveOrder();
if (answer.Item1 == false) CreateAndShowMessageDialog(answer.Item2);
Frame.Navigate(typeof(OrderPage));
}
示例8: OpenStoreRating
private async void OpenStoreRating(IUICommand command)
{
string name = Package.Current.Id.FamilyName;
await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:REVIEW?PFN=" + name));
//await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:REVIEW?PFN=6b7b722b-a69d-42fc-8fba-f1b30776edec"));
//SaveAppRatingSetting();
}
示例9: CommandInvokedHandler
private static async void CommandInvokedHandler(IUICommand command)
{
if (command.Label == Utils.Utils.ResourceLoader.GetString("Text_Review"))
{
await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:reviewapp?appid=" + CurrentApp.AppId));
}
}
示例10: HandlePrivacyPolocySettingsCommand
private void HandlePrivacyPolocySettingsCommand(IUICommand command)
{
var settings = new SettingsFlyout();
settings.Content = new PrivacyPolicySettingsView();
settings.HeaderText = "Privacy Policy";
settings.IsOpen = true;
}
示例11: 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;
}
示例12: CommandInvokedHandler
private async void CommandInvokedHandler(IUICommand command)
{
if (command.Id.ToString() == "0")
{
await Execute();
}
}
示例13: CommandInvokedHandler
static private async void CommandInvokedHandler(IUICommand command)
{
messageShown = false;
if (command.Label == "Submit Feedback")
{
await Windows.System.Launcher.LaunchUriAsync(new Uri("mailto:kyle.de[email protected]?subject=HudlRT%20Feedback"));
}
}
示例14: About_Click
private void About_Click(IUICommand cmd) {
SettingsFlyout settings = new SettingsFlyout();
settings.Background = new SolidColorBrush(Colors.White);
settings.HeaderBrush = new SolidColorBrush(Colors.Black);
settings.Content = new AboutPanel();
settings.HeaderText = "About";
settings.IsOpen = true;
RestoreCursor(); }
示例15: CommandInvokedHandler
private void CommandInvokedHandler(IUICommand command)
{
if (command.Label == "Delete")
{
App.DataModel.DeleteNote(note);
Frame.Navigate(typeof(SeeHistory));
}
}