Пример #1
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            IntPtr hwnd = new WindowInteropHelper(this).Handle;

            HwndSource.FromHwnd(hwnd).AddHook(WndProc);
            wndList = new List <FrameworkElement>
            {
                Wnd1, Wnd2, Wnd3, Wnd4, Wnd5, Wnd6, Wnd7
            };

            PlaybackView.Current.DockControl.Show();
            if (!LayoutHelper <Config> .ApplyLayout(DockManager, this))
            {
                LyricEditorView.Current.DockControl.Show();
            }

            //sliderBinding = new Binding();
            //sliderBinding.Source = PlaybackView.Current.Position;
            //sliderBinding.Path = new PropertyPath("Percentage");

            if (Config.Current.HideWelcome)
            {
                return;
            }

            CheckBox welcomeBox = new CheckBox
            {
                Margin = new Thickness(12, 8, 12, 8),
                HorizontalAlignment = HorizontalAlignment.Left,
                Content             = "不要再提醒。"
            };

            welcomeBox.Checked   += (o, args) => Config.Current.HideWelcome = true;
            welcomeBox.Unchecked += (o, args) => Config.Current.HideWelcome = false;
            NotificationManager
            .CreateMessage()
            .Accent("#007ACC")
            .Background("#333")
            .HasMessage("欢迎回来!点击“添加歌词”或轻敲 Ctrl+T 以开始。")
            .Dismiss().WithButton("添加歌词", button =>
            {
                LyricEditorView.Current.AddLyrics_Executed(null, null);
            })
            .Dismiss().WithButton("消除", button => { })
            .WithAdditionalContent(ContentLocation.Bottom,
                                   new Border
            {
                BorderThickness = new Thickness(0, 1, 0, 0),
                BorderBrush     = new SolidColorBrush(Color.FromArgb(128, 28, 28, 28)),
                Child           = welcomeBox
            })
            .Queue();
        }