本文整理汇总了C#中Microsoft.Phone.Shell.ApplicationBar类的典型用法代码示例。如果您正苦于以下问题:C# ApplicationBar类的具体用法?C# ApplicationBar怎么用?C# ApplicationBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationBar类属于Microsoft.Phone.Shell命名空间,在下文中一共展示了ApplicationBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: hideAppBar
public void hideAppBar(string jsonArgs)
{
try
{
//var items = JsonHelper.Deserialize<string[]>(jsonArgs);
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
if (frame != null)
{
PhoneApplicationPage page = frame.Content as PhoneApplicationPage;
if (page != null)
{
ApplicationBar bar = new ApplicationBar();
bar.Mode = ApplicationBarMode.Minimized;
bar.Opacity = 0;
bar.IsVisible = false;
bar.IsMenuEnabled = false;
page.ApplicationBar = bar;
// page.ApplicationBar.IsVisible = false;
}
}
});
DispatchCommandResult(new PluginResult(PluginResult.Status.OK, ""));
}
catch (Exception ex)
{
DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ex.Message));
}
}
示例2: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
startTime = DateTime.Now;
if (Debugger.IsAttached)
{
DebugPanel.Visibility = Visibility.Visible;
ApplicationBar = new ApplicationBar();
ApplicationBar.Mode = ApplicationBarMode.Minimized;
ApplicationBar.Opacity = 1.0;
ApplicationBar.IsVisible = true;
ApplicationBar.IsMenuEnabled = true;
// Adding a menu item
ApplicationBarMenuItem myMenuItem = new ApplicationBarMenuItem();
myMenuItem.Text = "open debugger";
myMenuItem.Click += toggleDebugger;
ApplicationBar.MenuItems.Add(myMenuItem);
// Adding a menu item
ApplicationBarMenuItem minDebugger = new ApplicationBarMenuItem();
minDebugger.Text = "minimize debugger";
minDebugger.Click += minDebug;
ApplicationBar.MenuItems.Add(minDebugger);
}
}
示例3: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
// Add an Application Bar with a 'setting menu item.
ApplicationBar = new ApplicationBar();
ApplicationBar.IsMenuEnabled = true;
ApplicationBar.IsVisible = true;
ApplicationBar.Opacity = 1.0;
ApplicationBar.Mode = ApplicationBarMode.Minimized;
var settingsItem = new ApplicationBarIconButton(new Uri("/Images/appbar.feature.settings.rest.png", UriKind.Relative));
var helpItem = new ApplicationBarIconButton(new Uri("/Images/appbar.questionmark.rest.png", UriKind.Relative));
var shareItem = new ApplicationBarIconButton(new Uri("/Images/share.png", UriKind.Relative));
var rateItem = new ApplicationBarIconButton(new Uri("/Images/appbar.favs.rest.png", UriKind.Relative));
settingsItem.Text = "settings";
helpItem.Text = "help";
shareItem.Text = "share";
rateItem.Text = "rate";
settingsItem.Click += SettingsClick;
helpItem.Click += HelpClick;
shareItem.Click += TwitterItemOnClick;
rateItem.Click += RateItemOnClick;
ApplicationBar.Buttons.Add(shareItem);
ApplicationBar.Buttons.Add(settingsItem);
ApplicationBar.Buttons.Add(helpItem);
ApplicationBar.Buttons.Add(rateItem);
Ad1.ApplicationId = "xxxxxx";
Ad1.AdUnitId = "xxxxxx";
}
示例4: BuildLocalizedApplicationBar
private void BuildLocalizedApplicationBar()
{
ApplicationBar = new ApplicationBar();
ApplicationBarIconButton undoButton = new ApplicationBarIconButton(new Uri("/Assets/back.png", UriKind.Relative)) { Text = AppResources.UndoAppBar };
undoButton.Click += undoButton_Click;
ApplicationBar.Buttons.Add(undoButton);
ApplicationBarIconButton clearContentButton = new ApplicationBarIconButton(new Uri("/Assets/close.png", UriKind.Relative)) { Text = AppResources.ClearAppBar };
clearContentButton.Click += clearContentButton_Click;
ApplicationBar.Buttons.Add(clearContentButton);
ApplicationBarIconButton openButton = new ApplicationBarIconButton(new Uri("/Assets/folder.png", UriKind.Relative)) { Text = AppResources.OpenAppBar };
openButton.Click += openButton_Click;
ApplicationBar.Buttons.Add(openButton);
ApplicationBarIconButton saveButton = new ApplicationBarIconButton(new Uri("/Assets/save.png", UriKind.Relative)) { Text = AppResources.SaveAppBar };
saveButton.Click += saveButton_Click;
ApplicationBar.Buttons.Add(saveButton);
ApplicationBarMenuItem rateMenuItem = new ApplicationBarMenuItem(AppResources.RateAppBar);
rateMenuItem.Click += rateButton_Click;
ApplicationBar.MenuItems.Add(rateMenuItem);
ApplicationBarMenuItem infoMenuItem = new ApplicationBarMenuItem(AppResources.InfoAppBar);
infoMenuItem.Click += infoMenuItem_Click;
ApplicationBar.MenuItems.Add(infoMenuItem);
}
示例5: BuildLocalizedApplicationBar
private void BuildLocalizedApplicationBar()
{
ApplicationBar = new ApplicationBar();
ApplicationBarIconButton sendButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/feature.email.png", UriKind.Relative));
sendButton.Text = AppResources.SendButtonText;
ApplicationBar.Buttons.Add(sendButton);
sendButton.Click += Send;
// TODO: Need paperclip icon
ApplicationBarIconButton attachButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/attach.png", UriKind.Relative));
attachButton.Text = AppResources.AttachButtonText;
ApplicationBar.Buttons.Add(attachButton);
attachButton.Click += Attach;
ApplicationBarIconButton discardButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/cancel.png", UriKind.Relative));
discardButton.Text = AppResources.DiscardButtonText;
ApplicationBar.Buttons.Add(discardButton);
discardButton.Click += Discard;
ApplicationBarIconButton dictateButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/microphone.png", UriKind.Relative));
dictateButton.Text = AppResources.DictateButtonText;
ApplicationBar.Buttons.Add(dictateButton);
dictateButton.Click += Dictate;
ApplicationBarMenuItem labelMenuItem = new ApplicationBarMenuItem(AppResources.LabelItemText);
ApplicationBar.MenuItems.Add(labelMenuItem);
labelMenuItem.Click += LabelClick;
}
示例6: BuildApplicationBar
//----------------------------------------------------------------------
#endregion
//----------------------------------------------------------------------
//----------------------------------------------------------------------
#region --- Methods ---
//----------------------------------------------------------------------
/// <summary>
/// Builds the application bar.
/// </summary>
private void BuildApplicationBar()
{
if (ApplicationBar == null)
{
ApplicationBar = new ApplicationBar();
}
var addButton = new ApplicationBarIconButton(new Uri("/Images/ApplicationBar/GroupManagement/add.png", UriKind.Relative));
addButton.Text = AppResources.UI_GroupManagement_ApplicationBar_Add;
addButton.Click += Add;
_deleteButton = new ApplicationBarIconButton(new Uri("/Images/ApplicationBar/GroupManagement/delete.png", UriKind.Relative));
_deleteButton.Text = AppResources.UI_GroupManagement_ApplicationBar_Delete;
_deleteButton.Click += Delete;
_deleteAllMenuItem = new ApplicationBarMenuItem();
_deleteAllMenuItem.Text = AppResources.UI_GroupManagement_ApplicationBar_DeleteAll;
_deleteAllMenuItem.Click += DeleteAll;
ApplicationBar.Buttons.Add(addButton);
ApplicationBar.Buttons.Add(_deleteButton);
ApplicationBar.MenuItems.Add(_deleteAllMenuItem);
UpdateApplicationBarItems();
}
示例7: SetupAppBar_TypeFrequency
private void SetupAppBar_TypeFrequency()
{
ApplicationBar = new ApplicationBar();
ApplicationBar.IsVisible = true;
ApplicationBarIconButton save = new ApplicationBarIconButton();
save.IconUri = new Uri("/Assets/icons/Dark/save.png", UriKind.Relative);
save.Text = AppResources.AppBarButtonSave;
ApplicationBar.Buttons.Add(save);
save.Click += new EventHandler(Save_Click);
ApplicationBarIconButton saveContinute = new ApplicationBarIconButton();
saveContinute.IconUri = new Uri("/Assets/icons/Dark/refresh.png", UriKind.Relative);
saveContinute.Text = AppResources.AppBarButtonContinue;
ApplicationBar.Buttons.Add(saveContinute);
save.Click += new EventHandler(Continue_Click);
ApplicationBarIconButton delete = new ApplicationBarIconButton();
delete.IconUri = new Uri("/Assets/icons/Dark/delete.png", UriKind.Relative);
delete.Text = AppResources.AppBarButtonDelete;
ApplicationBar.Buttons.Add(delete);
save.Click += new EventHandler(Delete_Click);
ApplicationBarIconButton add = new ApplicationBarIconButton();
add.IconUri = new Uri("/Assets/icons/Dark/add.png", UriKind.Relative);
add.Text = AppResources.AppBarButtonAdd;
ApplicationBar.Buttons.Add(add);
add.Click += new EventHandler(Add_Click);
ApplicationBarMenuItem mainMenu = new ApplicationBarMenuItem();
mainMenu.Text = AppResources.AppBarButtonMainMenu;
ApplicationBar.MenuItems.Add(mainMenu);
mainMenu.Click += new EventHandler(MainMenu_Click);
}
示例8: BuildLocalizedApplicationBar
private void BuildLocalizedApplicationBar()
{
ApplicationBar = new ApplicationBar();
ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem("Visitor");
appBarMenuItem.Click += appBarMenuItem_Click;
ApplicationBar.MenuItems.Add(appBarMenuItem);
}
示例9: FeedbackPage
public FeedbackPage()
{
ApplicationBar = new ApplicationBar();
ApplicationBar.Mode = ApplicationBarMode.Default;
ApplicationBar.StateChanged += (sender, e) =>
{
var bar = (sender as ApplicationBar);
if (CurrentViewState.Equals(FeedbackViewState.ImageShow) || CurrentViewState.Equals(FeedbackViewState.ImageEdit)) {
if (e.IsMenuVisible)
{
bar.Opacity = 0.75;
}
else
{
bar.Opacity = 0;
}
}
};
Action<FeedbackViewState> switchViewStateAction = (newViewState) =>
{
SwitchToViewState(newViewState);
};
this.VM = new FeedbackPageVM(switchViewStateAction);
this.formControl = new FeedbackMessageFormControl(this);
this.listControl = new FeedbackMessageListControl(this);
this.imageControl = new FeedbackImageControl(this);
initializeAppBarIcons();
InitializeComponent();
}
示例10: MainPage
//public bool _firstTime = true;
public MainPage()
{
InitializeComponent();
#region Application Bar
ApplicationBar = new ApplicationBar { IsMenuEnabled = true, IsVisible = true, Opacity = .9 };
var tweet = new ApplicationBarIconButton(new Uri("/Images/tweet.png", UriKind.Relative));
tweet.Text = "tweet";
tweet.Click += new EventHandler(btnTweetButton_Click);
var refresh = new ApplicationBarIconButton(new Uri("/Images/refresh.png", UriKind.Relative));
refresh.Text = "refresh";
refresh.Click += new EventHandler(btnRefreshButton_Click);
//var accountSetting = new ApplicationBarMenuItem();
//accountSetting.Text = "Change account";
//accountSetting.Click += new EventHandler(btnAccSetting_Click);
var support = new ApplicationBarMenuItem();
support.Text = "About";
support.Click += new EventHandler(support_Click);
ApplicationBar.Buttons.Add(tweet);
ApplicationBar.Buttons.Add(refresh);
//ApplicationBar.MenuItems.Add(accountSetting);
ApplicationBar.MenuItems.Add(support);
#endregion
// Set the data context of the listbox control to the sample data
DataContext = App.ViewModel;
Loaded += MainPage_Loaded;
}
示例11: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
// Set the data context of the listbox control to the sample data
DataContext = App.ViewModel;
//// Add a new background Image
BitmapImage bitmapImage = new BitmapImage(new Uri("PanoramaBackground.png", UriKind.Relative));
ImageBrush imageBrush = new ImageBrush();
imageBrush.ImageSource = bitmapImage;
PanoControl.Background = imageBrush;
ApplicationBar = new ApplicationBar();
//adding an iconbutton
ApplicationBarIconButton About = new ApplicationBarIconButton();
About.Text = AppResources.About;
About.Click += About_Click;
About.IconUri = new Uri("/Assets/Icons/appbar.information.circle.png", UriKind.Relative);
//adding another icon button
ApplicationBarIconButton Exit = new ApplicationBarIconButton();
Exit.Text = AppResources.Exit;
Exit.Click += Exit_Click;
Exit.IconUri = new Uri("/Assets/Icons/appbar.stop.png", UriKind.Relative);
//ApplicationBar.Buttons.Add(Home);
ApplicationBar.Buttons.Add(About);
ApplicationBar.Buttons.Add(Exit);
}
示例12: BuildApplicationBar
/// <summary>
/// Builds the application bar.
/// </summary>
private void BuildApplicationBar()
{
if (ApplicationBar == null)
{
ApplicationBar = new ApplicationBar();
}
var searchButton = new ApplicationBarIconButton(new Uri("/Images/ApplicationBar/GuildList/search.png", UriKind.Relative));
searchButton.Text = AppResources.UI_GuildList_ApplicationBar_Search;
searchButton.Click += ShowGuildSearchView;
_deleteAllButton = new ApplicationBarIconButton(new Uri("/Images/ApplicationBar/CharacterList/delete.png", UriKind.Relative));
_deleteAllButton.Text = AppResources.UI_CharacterList_ApplicationBar_DeleteAll;
_deleteAllButton.Click += DeleteAll;
_sortByNameMenuItem = new ApplicationBarMenuItem(AppResources.UI_GuildList_ApplicationBar_SortByName);
_sortByNameMenuItem.Click += SortByName;
_sortByLevelMenuItem = new ApplicationBarMenuItem(AppResources.UI_GuildList_ApplicationBar_SortByLevel);
_sortByLevelMenuItem.Click += SortByLevel;
_sortByMembersMenuItem = new ApplicationBarMenuItem(AppResources.UI_GuildList_ApplicationBar_SortByMembers);
_sortByMembersMenuItem.Click += SortByMembers;
ApplicationBar.Buttons.Add(searchButton);
ApplicationBar.Buttons.Add(_deleteAllButton);
ApplicationBar.MenuItems.Add(_sortByNameMenuItem);
ApplicationBar.MenuItems.Add(_sortByLevelMenuItem);
ApplicationBar.MenuItems.Add(_sortByMembersMenuItem);
UpdateApplicationBarItems();
}
示例13: Settings
public Settings()
{
InitializeComponent();
// Add an Application Bar that has a 'done' confirmation button and
// a 'cancel' button
ApplicationBar = new ApplicationBar();
ApplicationBar.IsMenuEnabled = true;
ApplicationBar.IsVisible = true;
ApplicationBar.Opacity = 1.0;
ApplicationBarIconButton doneButton = new ApplicationBarIconButton(new Uri("/Images/appbar.check.rest.png", UriKind.Relative));
doneButton.Text = "done";
doneButton.Click += new EventHandler(doneButton_Click);
ApplicationBarIconButton cancelButton = new ApplicationBarIconButton(new Uri("/Images/appbar.Close.rest.png", UriKind.Relative));
cancelButton.Text = "cancel";
cancelButton.Click += new EventHandler(cancelButton_Click);
ApplicationBar.Buttons.Add(doneButton);
ApplicationBar.Buttons.Add(cancelButton);
toEmailTextBlock.Text = settings.ToEmailSetting;
toNameTextBlock.Text = settings.ToNameSetting;
dayStartTextBox.Text = settings.DayStartSetting;
lunchStartTextBox.Text = settings.LunchStartSetting;
lunchEndTextBox.Text = settings.LunchEndSetting;
dayEndTextBox.Text = settings.DayEndSetting;
}
示例14: BlogSettingsPage
public BlogSettingsPage()
{
InitializeComponent();
DataContext = App.MasterViewModel;
_localizedStrings = App.Current.Resources["StringTable"] as StringTable;
_thumbnailSizes = new List<string>();
_thumbnailSizes.Add(_localizedStrings.ControlsText.OriginalSize);
int limit = 10;
for (int i = 1; i < limit; i++)
{
_thumbnailSizes.Add((i * 100).ToString());
}
ApplicationBar = new ApplicationBar();
ApplicationBar.BackgroundColor = (Color)App.Current.Resources["AppbarBackgroundColor"];
ApplicationBar.ForegroundColor = (Color)App.Current.Resources["WordPressGrey"];
_saveIconButton = new ApplicationBarIconButton(new Uri("/Images/appbar.save.png", UriKind.Relative));
_saveIconButton.Text = _localizedStrings.ControlsText.Save;
_saveIconButton.Click += OnSaveButtonClick;
ApplicationBar.Buttons.Add(_saveIconButton);
Loaded += OnPageLoaded;
}
示例15: BuildAppBar
private void BuildAppBar()
{
_shareAppBar = new ApplicationBar();
ShareButton = new ApplicationBarIconButton(new Uri("/Assets/images/check.png", UriKind.Relative))
{
Text = "share",
IsEnabled = false
};
ShareButton.Click += (sender, args) =>
{
viewModel.ShareTask();
Focus();
};
_shareAppBar.Buttons.Add(ShareButton);
var about = new ApplicationBarMenuItem(AppResources.about);
about.Click +=
(sender, args) => NavigationService.Navigate(new Uri("/Views/AboutView.xaml", UriKind.Relative));
var logout = new ApplicationBarMenuItem("logout");
logout.Click += (sender, args) => Logout();
_shareAppBar.MenuItems.Add(logout);
_shareAppBar.MenuItems.Add(about);
_photosAppBar = new ApplicationBar();
_photosAppBar.MenuItems.Add(logout);
_photosAppBar.MenuItems.Add(about);
}