示例#1
0
        protected void HandleSearch()
        {
            UriBuilder uriBuilder = new UriBuilder(NavigationManager.Uri).ClearQuery();

            if (SearchStatus != -1)
            {
                uriBuilder.AddQuery("status", SearchStatus.ToString());
            }

            if (IsDateAsc)
            {
                uriBuilder.AddQuery("dateAsc", IsDateAsc.ToString());
            }

            NavigationManager.NavigateTo(uriBuilder.ToString(), true);
        }
示例#2
0
        public string GetSearchStatus(SearchStatus ss = SearchStatus.Unknown)
        {
            if (ss == SearchStatus.Unknown)
            {
                ss = status;
            }
            else
            {
                status = ss;
            }

            return(ss switch
            {
                SearchStatus.Ready => (string?)Avalonia.Application.Current.FindResource("StatusReady") ?? ss.ToString().ToUpper(),
                SearchStatus.Initializing => (string?)Avalonia.Application.Current.FindResource("StatusInitializing") ?? ss.ToString().ToUpper(),
                SearchStatus.Running => (string?)Avalonia.Application.Current.FindResource("StatusRunning") ?? ss.ToString().ToUpper(),
                _ => ss.ToString().ToUpper()
            });