日日操夜夜添-日日操影院-日日草夜夜操-日日干干-精品一区二区三区波多野结衣-精品一区二区三区高清免费不卡

公告:魔扣目錄網為廣大站長提供免費收錄網站服務,提交前請做好本站友鏈:【 網站目錄:http://www.ylptlb.cn 】, 免友鏈快審服務(50元/站),

點擊這里在線咨詢客服
新站提交
  • 網站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會員:747

今日 10 點,上海,微軟中國在 Windows 8 10 月 26 日的全球正式發布前,帶我們先睹這全新的系統和硬件的魅力所在!

微軟全球 Windows 與 Windows Live 事業部總裁 Steven Sinofsky 和微軟全球資深副總裁、大中華區董事長兼首席執行官賀樂賦( Ralph Haupter )共同出席了慶?;顒?。

漫長的等待,Win 8 終于快發布了。期待中。。。

下面是我自己學習的Win 8小Sample,為了以后方便學習,特做一些記錄。

效果如下圖: 右邊添加了三個命令,分別為:First Custom Command,Second Custom Command,Third Custom Command。

圖1-設置面版

圖2-自定義用戶控件 右邊的控件是用戶自己定義的控件,我這里定義的很簡單。

關鍵代碼如下:

1、添加命令道設置面版中. 分別添加了三個命令。以及三個命令對應的操作。這里定義的很簡單,自己可以定義的更復雜一些。

        private void AddCommandToSettingPanel()
        {
            //Add three command to Setting Panel.
            SettingsCommand cmd1 = new SettingsCommand("1", "First Custom Command",
                c =>
                {
                    SettingPanelUC uc = new SettingPanelUC();
                    uc.Show();
                });
            SettingsCommand cmd2 = new SettingsCommand("2", "Second Custom Command",
                c =>
                {
                    ShowMessageTBK.Text = "Second Custom Command Click";
                });
            SettingsCommand cmd3 = new SettingsCommand("3", "Third Custom Command",
                c =>
                {
                    ShowMessageTBK.Text = "Third Custom Command Click";
                });

            //Add command in CommandsRequested Event.
            SettingsPane.GetForCurrentView().CommandsRequested += (sp, arg) =>
            {
                arg.Request.ApplicationCommands.Add(cmd1);
                arg.Request.ApplicationCommands.Add(cmd2);
                arg.Request.ApplicationCommands.Add(cmd3);
            };
        }


2、顯示設置面版

        private void ShowSettingsPanel(object sender, RoutedEventArgs e)
        {
            //Show Setting Panel
            Windows.UI.ApplicationSettings.SettingsPane.Show();
        }


3、自定義控件關鍵代碼:

public sealed partial class SettingPanelUC : UserControl
    {
        Popup pop = null;
        public SettingPanelUC()
        {
            this.InitializeComponent();
            this.Width = 360d;
            this.Height = Window.Current.Bounds.Height;
            this.pop = new Popup();
            this.pop.Child = this;
            this.pop.IsLightDismissEnabled = true;

            //Make the user control is on the right.
            pop.HorizontalOffset = Window.Current.Bounds.Width - this.Width;
            pop.VerticalOffset = 0d;

            //Animation for the user control.
            this.Transitions = new Windows.UI.Xaml.Media.Animation.TransitionCollection();
            EdgeUIThemeTransition et = new EdgeUIThemeTransition();
            et.Edge = EdgeTransitionLocation.Right;
            this.Transitions.Add(et);         
        }

        /// <summary>
        /// 顯示控件
        /// </summary>
        public void Show()
        {
            if (pop != null)
            {
                pop.IsOpen = true;
            }
        }

        /// <summary>
        /// 隱藏控件
        /// </summary>
        public void Hide()
        {
            if (pop != null)
            {
                pop.IsOpen = false;
            }
        }

        private void Back(object sender, RoutedEventArgs e)
        {
            this.Hide();
            Windows.UI.ApplicationSettings.SettingsPane.Show();
        }
    }


總結:Win 8 設置面版還是挺簡單的,我這里只是學習寫了一些簡單的東西,并記錄下,方便自己以后再次學習。當然,里面的自定義控件的復雜邏輯還是要靠自己去寫的。

分享到:
標簽:自定義 面版 手工 設置 支持
用戶無頭像

網友整理

注冊時間:

網站:5 個   小程序:0 個  文章:12 篇

  • 51998

    網站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會員

趕快注冊賬號,推廣您的網站吧!
最新入駐小程序

數獨大挑戰2018-06-03

數獨一種數學游戲,玩家需要根據9

答題星2018-06-03

您可以通過答題星輕松地創建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學四六

運動步數有氧達人2018-06-03

記錄運動步數,積累氧氣值。還可偷

每日養生app2018-06-03

每日養生,天天健康

體育訓練成績評定2018-06-03

通用課目體育訓練成績評定