/// <summary>
        /// 点击搜索按钮->切换页面->页面中请求数据->获取数据->传送到页面->展示
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CmbSearch_SearchBtnClick(object sender, RoutedEventArgs e)
        {
            if (FindResource("MusicSource") is Grid musicSourceGrid)
            {
                RadioButton qmSource = null;
                if ((qmSource = musicSourceGrid.GetChildObjectByName <RadioButton>("RdQM")) != null)
                {
                    var searchKey = CmbSearch.Text;
                    if (!IsValidateSearchKey(ref searchKey))
                    {
                        return;
                    }
                    SaveSearchRecords(searchKey);

                    if (qmSource.IsChecked == true)
                    {
                        MusicPageChangedUtil.Invoke(_qmSearchPageName, true);
                    }
                    else
                    {
                        var musicSearchPage = new MusicSearchPage(_lastSearchKey);
                        (App.Current.MainWindow.FindName("FMusicPage") as Frame).Navigate(musicSearchPage);
                    }
                    NonNavPageDisplayedUtil.Invoke();
                }
            }
        }
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            Waiting.Visibility = Visibility.Visible;
            TbError.Visibility = Visibility.Collapsed;
            GdSong.Visibility  = Visibility.Collapsed;
            NonNavPageDisplayedUtil.Invoke();

            MusicSearchInfoChangedUtil.InvokeFromQMRequest(1);
        }
Exemple #3
0
        public static void FMusicPageNavigateTo(Page page, bool hasNavigateBar = true)
        {
            var frame = App.Current.MainWindow.FindName("FMusicPage") as Frame;

            frame.Navigate(page);

            MusicPageSwitchedUtil.InvokeOfCanPrevious(true);
            MusicPageSwitchedUtil.InvokeOfCanNext(false);
            if (!hasNavigateBar)
            {
                NonNavPageDisplayedUtil.Invoke();
            }
        }
        public SettingPage()
        {
            InitializeComponent();

            NonNavPageDisplayedUtil.Invoke();
        }