2013-08-20 26 views
0

通過使用Callisto我寫了一個代碼,添加設置魅力。如何通過使用按鈕而不是設置魅力顯示設置彈出窗口

下方附上一個:

// Register handler for CommandsRequested events from the setting pane 
SettingsPane.GetForCurrentView().CommandsRequested += OnCommandsRequested; 

void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) 
{ 
    // Add an Adding Feeds command 
    var add = new SettingsCommand("add", "Add new Feed", (handler) => 
    { 
     var settings = new SettingsFlyout(); 
     settings.Content = new AddingPageUserControl(); 
     settings.HeaderBrush = (SolidColorBrush)Application.Current.Resources["UserControlBackgraund"]; 
     settings.Background = (SolidColorBrush)Application.Current.Resources["UserControlBackgraund"]; 
     settings.HeaderText = "Add new Feed"; 
     settings.IsOpen = true; 
    }); 

    args.Request.ApplicationCommands.Add(add); 
} 

而且我不知道如何創建AppBar一個按鈕,我用設定的魅力將其打開這將打開相同的設置彈出。我的問題是:是否有可能創建它,如果是的話,我需要一種提示。

回答

0

您可以使用Page.BottomAppBar找到AppBar並使用FindName方法找到一個特定的按鈕併爲其添加處理程序。 唯一的一點是你目前在一個匿名函數中創建你的SettingFlyout,所以只有你可以做到這一點將會在你的匿名函數中。

相關問題