/// <summary> /// 同步请求 /// </summary> /// <param name="busy"></param> /// <param name="methodid"></param> /// <param name="args"></param> /// <returns></returns> public static API.Result Request(RadBusyIndicator busy, int methodid, List <object> args) { if (busy == null) { busy = new RadBusyIndicator(); } busy.IsBusy = true; if (args == null) { args = new List <object>(); } if (methodid != 1) { if (!Store.IsLogin) { NavigationWindow window = new NavigationWindow(); window.Source = new Uri("Login.xaml", UriKind.Relative); window.Show(); } args.Insert(0, Store.CurrentUser == null ? new API.UserInfo() : Store.CurrentUser); } API.BMSServiceClient client = new API.BMSServiceClient(); client.Open(); API.Result ret = client.Execute(methodid, args); client.Close(); busy.IsBusy = false; return(ret); }
public CustomFilterBehavior(RadGridView gridView, RadWatermarkTextBox textBlock, RadBusyIndicator busyIndicator) { this.gridView = gridView; this.textBlock = textBlock; this.busyIndicator = busyIndicator; this.textBlock.TextChanged -= this.OnTextBlockTextChanged; this.textBlock.TextChanged += this.OnTextBlockTextChanged; }
public static void ShowMask(bool isMask, string message) { if (App.Current.RootVisual != null) { RadBusyIndicator busy = App.Current.RootVisual.FindChildByType <RadBusyIndicator>(); if (busy != null) { busy.IsBusy = isMask; busy.BusyContent = "正在加载数据..."; if (!string.IsNullOrEmpty(message)) { busy.BusyContent = message; } } } }
/// <inheritdoc/> protected override bool ApplyTemplateCore() { bool applied = base.ApplyTemplateCore(); this.indicator = this.GetTemplateChild("PART_Indicator") as ContentPresenter; applied = applied && this.indicator != null; this.busyIndicator = this.GetTemplateChild("BusyIndicator") as RadBusyIndicator; applied = applied && this.busyIndicator != null; this.refreshLabel = this.GetTemplateChild("PART_RefreshInfoLabel") as TextBlock; applied = applied && this.refreshLabel != null; this.refreshTime = this.GetTemplateChild("PART_RefreshTimeLabel") as TextBlock; applied = applied && this.refreshTime != null; return(applied); }
public BusyIndicatorGettingStartedCSharp() { // >> busyindicator-getting-started-csharp RadBusyIndicator radBusyIndicator = new RadBusyIndicator() { IsBusy = true, Content = new Label() { Text = "This is the content of the RadBusyIndicator control displayed when the indicator is not busy.", TextColor = Color.Black }, AnimationContentWidthRequest = 100, AnimationContentHeightRequest = 100, }; // << busyindicator-getting-started-csharp this.Content = radBusyIndicator; }
protected void InitializeWindow(string title) { if (Application.Current.IsRunningOutOfBrowser) { Application.Current.MainWindow.Title = title; Application.Current.MainWindow.WindowState = WindowState.Maximized; } else { System.Windows.Browser.HtmlPage.Window.Eval(string.Format("document.title=\"{0}\"", title)); } WaitSpinner = new RadBusyIndicator { BusyContent = GetResourceString("Loading"), DisplayAfter = TimeSpan.FromSeconds(1.75), IsTabStop = false, }; MainWindow.LayoutRoot.Children.Add(WaitSpinner); }
/// <summary> /// 发起异步请求 /// </summary> /// <param name="busy"></param> /// <param name="methodid"></param> /// <param name="args"></param> /// <param name="CompletedEvent"></param> public static void RequestAsync(RadBusyIndicator busy, int methodid, List <object> args, EventHandler <API.ExecuteCompletedEventArgs> CompletedEvent) { if (busy == null) { busy = new RadBusyIndicator(); } busy.IsBusy = true; if (args == null) { args = new List <object>(); } if (methodid != 1) { if (!Store.IsLogin) { NavigationWindow window = new NavigationWindow(); window.Source = new Uri("Login.xaml", UriKind.Relative); window.Show(); } args.Insert(0, Store.CurrentUser == null ? new API.UserInfo() : Store.CurrentUser); } API.BMSServiceClient client = new API.BMSServiceClient(); //清除所有代理 防止回调完成时执行其他Completed事件 var c1Type = client.GetType(); var field = c1Type.GetField("ExecuteCompleted", BindingFlags.NonPublic | BindingFlags.Instance); MulticastDelegate multicastDelegate = field.GetValue(client) as MulticastDelegate; if (multicastDelegate != null) { Delegate[] dels = multicastDelegate.GetInvocationList(); foreach (var listener in dels) { client.ExecuteCompleted -= listener as EventHandler <API.ExecuteCompletedEventArgs>; //Do what you got to do to ensure the listener is not a zombie } } client.ExecuteCompleted += CompletedEvent; client.ExecuteAsync(methodid, args); }
public AnimationsCSharp() { // >> busyindicator-animations-csharp RadBusyIndicator radBusyIndicator = new RadBusyIndicator() { IsBusy = true, AnimationType = AnimationType.Custom, Content = new Label() { Text = "This is the content of the RadBusyIndicator control displayed when the indicator is not busy." }, BusyContent = new Label() { Text = "Loading...", VerticalOptions = new LayoutOptions(LayoutAlignment.Center, false), HorizontalOptions = new LayoutOptions(LayoutAlignment.Center, false), }, }; RadDoubleAnimation annimation = new RadDoubleAnimation() { Duration = 800, From = 0.1, To = 1, PropertyPath = "Opacity", Target = radBusyIndicator.BusyContent, RepeatForever = true, AutoReverse = true }; radBusyIndicator.Animations.Add(annimation); Device.StartTimer(TimeSpan.FromMilliseconds(5000), () => { radBusyIndicator.IsBusy = false; return(false); }); // << busyindicator-animations-csharp Content = radBusyIndicator; }
/// <summary> /// Initializes a new instance of the RadBusyIndicatorAutomationPeer class. /// </summary> /// <param name="owner">The RadBusyIndicator that is associated with this RadBusyIndicatorAutomationPeer.</param> public RadBusyIndicatorAutomationPeer(RadBusyIndicator owner) : base(owner) { }
public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; System.Windows.Application.LoadComponent(this, new System.Uri("/Procbel.Apps.Silverlight;component/Shell.xaml", System.UriKind.Relative)); this.InitialAnimation = ((System.Windows.Media.Animation.Storyboard)(this.FindName("InitialAnimation"))); this.PanelStates = ((System.Windows.VisualStateGroup)(this.FindName("PanelStates"))); this.HidePanel = ((System.Windows.VisualState)(this.FindName("HidePanel"))); this.ShowPanel = ((System.Windows.VisualState)(this.FindName("ShowPanel"))); this.PanelMenuStates = ((System.Windows.VisualStateGroup)(this.FindName("PanelMenuStates"))); this.HideMenuPanel = ((System.Windows.VisualState)(this.FindName("HideMenuPanel"))); this.ShowMenuPanel = ((System.Windows.VisualState)(this.FindName("ShowMenuPanel"))); this.PanelNavigationStates = ((System.Windows.VisualStateGroup)(this.FindName("PanelNavigationStates"))); this.Appearance = ((System.Windows.VisualState)(this.FindName("Appearance"))); this.EditAppearance = ((System.Windows.VisualState)(this.FindName("EditAppearance"))); this.Info = ((System.Windows.VisualState)(this.FindName("Info"))); this.Share = ((System.Windows.VisualState)(this.FindName("Share"))); this.Download = ((System.Windows.VisualState)(this.FindName("Download"))); this.grid4 = ((System.Windows.Controls.Grid)(this.FindName("grid4"))); this.grid3 = ((System.Windows.Controls.Grid)(this.FindName("grid3"))); this.path = ((System.Windows.Shapes.Path)(this.FindName("path"))); this.border1 = ((System.Windows.Controls.Border)(this.FindName("border1"))); this.LoadingMask1 = ((System.Windows.Media.ScaleTransform)(this.FindName("LoadingMask1"))); this.border2 = ((System.Windows.Controls.Border)(this.FindName("border2"))); this.LoadingMask2 = ((System.Windows.Media.ScaleTransform)(this.FindName("LoadingMask2"))); this.border4 = ((System.Windows.Controls.Border)(this.FindName("border4"))); this.LoadingMask3 = ((System.Windows.Media.ScaleTransform)(this.FindName("LoadingMask3"))); this.border5 = ((System.Windows.Controls.Border)(this.FindName("border5"))); this.LoadingMask4 = ((System.Windows.Media.ScaleTransform)(this.FindName("LoadingMask4"))); this.grid2 = ((System.Windows.Controls.Grid)(this.FindName("grid2"))); this.stackPanel1 = ((System.Windows.Controls.StackPanel)(this.FindName("stackPanel1"))); this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot"))); this.border = ((System.Windows.Controls.Border)(this.FindName("border"))); this.Header = ((System.Windows.Controls.Grid)(this.FindName("Header"))); this.SubMenuRegionPlaceholder = ((System.Windows.Controls.ContentControl)(this.FindName("SubMenuRegionPlaceholder"))); this.ModuleMenuRegionPlaceholder = ((System.Windows.Controls.ContentControl)(this.FindName("ModuleMenuRegionPlaceholder"))); this.HeaderRegionPlaceholder = ((System.Windows.Controls.ContentControl)(this.FindName("HeaderRegionPlaceholder"))); this.Title = ((System.Windows.Controls.TextBlock)(this.FindName("Title"))); this.stackPanel2 = ((System.Windows.Controls.StackPanel)(this.FindName("stackPanel2"))); this.SelectedRange = ((System.Windows.Controls.TextBlock)(this.FindName("SelectedRange"))); this.radToggleButtonAreas = ((RadToggleButton)(this.FindName("radToggleButtonAreas"))); this.gridMenuPanel = ((System.Windows.Controls.Grid)(this.FindName("gridMenuPanel"))); this.MainMenuRegionPlaceholder = ((System.Windows.Controls.ContentControl)(this.FindName("MainMenuRegionPlaceholder"))); this.BorderHeader = ((System.Windows.Shapes.Rectangle)(this.FindName("BorderHeader"))); this.radToggleButtonSettings = ((RadToggleButton)(this.FindName("radToggleButtonSettings"))); this.gridPanel = ((System.Windows.Controls.Grid)(this.FindName("gridPanel"))); this.stackPanel = ((System.Windows.Controls.StackPanel)(this.FindName("stackPanel"))); this.AppearancePane = ((RadRadioButton)(this.FindName("AppearancePane"))); this.InfoPane = ((RadRadioButton)(this.FindName("InfoPane"))); this.SharePane = ((RadRadioButton)(this.FindName("SharePane"))); this.DownloadPane = ((RadRadioButton)(this.FindName("DownloadPane"))); this.panelsGrid = ((System.Windows.Controls.Grid)(this.FindName("panelsGrid"))); this.appearance = ((System.Windows.Controls.StackPanel)(this.FindName("appearance"))); this.appearance_edit = ((System.Windows.Controls.Grid)(this.FindName("appearance_edit"))); this.info = ((System.Windows.Controls.StackPanel)(this.FindName("info"))); this.logo_Copy1 = ((System.Windows.Controls.Grid)(this.FindName("logo_Copy1"))); this.share = ((System.Windows.Controls.StackPanel)(this.FindName("share"))); this.download = ((System.Windows.Controls.StackPanel)(this.FindName("download"))); this.ModuleMenus = ((System.Windows.Controls.ContentControl)(this.FindName("ModuleMenus"))); this.ContentRegionPlaceholder = ((System.Windows.Controls.ContentControl)(this.FindName("ContentRegionPlaceholder"))); this.busyIndicator = ((RadBusyIndicator)(this.FindName("busyIndicator"))); this.BorderBottom = ((System.Windows.Shapes.Rectangle)(this.FindName("BorderBottom"))); }
private void InitializeComponent() { if (ResourceLoader.CanProvideContentFor(new ResourceLoader.ResourceLoadingQuery { AssemblyName = typeof(BusyPage).GetTypeInfo().Assembly.GetName(), ResourcePath = "Busy/BusyPage.xaml", Instance = this })) { __InitComponentRuntime(); return; } if (XamlLoader.XamlFileProvider != null && XamlLoader.XamlFileProvider(GetType()) != null) { __InitComponentRuntime(); return; } ReferenceExtension referenceExtension = new ReferenceExtension(); BindingExtension bindingExtension = new BindingExtension(); Label label = new Label(); RadBusyIndicator radBusyIndicator = new RadBusyIndicator(); StackLayout stackLayout = new StackLayout(); BusyPage busyPage; NameScope nameScope = (NameScope)(NameScope.GetNameScope(busyPage = this) ?? new NameScope()); NameScope.SetNameScope(busyPage, nameScope); ((INameScope)nameScope).RegisterName("This", (object)busyPage); if (busyPage.StyleId == null) { busyPage.StyleId = "This"; } This = busyPage; busyPage.SetValue(VisualElement.BackgroundColorProperty, new Color(0.0, 0.0, 0.0, 0.501960813999176)); busyPage.SetValue(PopupPage.CloseWhenBackgroundIsClickedProperty, false); stackLayout.SetValue(View.VerticalOptionsProperty, LayoutOptions.CenterAndExpand); stackLayout.SetValue(View.HorizontalOptionsProperty, LayoutOptions.CenterAndExpand); radBusyIndicator.SetValue(View.MarginProperty, new Thickness(10.0)); radBusyIndicator.SetValue(RadBusyIndicator.AnimationContentHeightRequestProperty, 100.0); radBusyIndicator.SetValue(RadBusyIndicator.AnimationContentWidthRequestProperty, 100.0); radBusyIndicator.SetValue(RadBusyIndicator.AnimationTypeProperty, AnimationType.Animation8); radBusyIndicator.SetValue(RadBusyIndicator.AnimationContentColorProperty, Color.White); radBusyIndicator.SetValue(RadBusyIndicator.IsBusyProperty, true); referenceExtension.Name = "This"; XamlServiceProvider xamlServiceProvider = new XamlServiceProvider(); Type typeFromHandle = typeof(IProvideValueTarget); object[] array = new object[0 + 5]; array[0] = bindingExtension; array[1] = label; array[2] = radBusyIndicator; array[3] = stackLayout; array[4] = busyPage; object service; xamlServiceProvider.Add(typeFromHandle, service = new SimpleValueTargetProvider(array, typeof(BindingExtension).GetRuntimeProperty("Source"), nameScope)); xamlServiceProvider.Add(typeof(IReferenceProvider), service); Type typeFromHandle2 = typeof(IXamlTypeResolver); XmlNamespaceResolver xmlNamespaceResolver = new XmlNamespaceResolver(); xmlNamespaceResolver.Add("", "http://xamarin.com/schemas/2014/forms"); xmlNamespaceResolver.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml"); xmlNamespaceResolver.Add("pages", "clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"); xmlNamespaceResolver.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives"); xamlServiceProvider.Add(typeFromHandle2, new XamlTypeResolver(xmlNamespaceResolver, typeof(BusyPage).GetTypeInfo().Assembly)); xamlServiceProvider.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(24, 21))); object target = bindingExtension.Source = ((IMarkupExtension)referenceExtension).ProvideValue((IServiceProvider)xamlServiceProvider); VisualDiagnostics.RegisterSourceInfo(target, new Uri("Busy\\BusyPage.xaml", UriKind.RelativeOrAbsolute), 24, 21); bindingExtension.Path = "Message"; BindingBase binding = ((IMarkupExtension <BindingBase>)bindingExtension).ProvideValue((IServiceProvider)null); label.SetBinding(Label.TextProperty, binding); label.SetValue(Label.TextColorProperty, Color.White); label.SetValue(Label.HorizontalTextAlignmentProperty, new TextAlignmentConverter().ConvertFromInvariantString("Center")); BindableProperty fontSizeProperty = Label.FontSizeProperty; FontSizeConverter fontSizeConverter = new FontSizeConverter(); XamlServiceProvider xamlServiceProvider2 = new XamlServiceProvider(); Type typeFromHandle3 = typeof(IProvideValueTarget); object[] array2 = new object[0 + 4]; array2[0] = label; array2[1] = radBusyIndicator; array2[2] = stackLayout; array2[3] = busyPage; object service2; xamlServiceProvider2.Add(typeFromHandle3, service2 = new SimpleValueTargetProvider(array2, Label.FontSizeProperty, nameScope)); xamlServiceProvider2.Add(typeof(IReferenceProvider), service2); Type typeFromHandle4 = typeof(IXamlTypeResolver); XmlNamespaceResolver xmlNamespaceResolver2 = new XmlNamespaceResolver(); xmlNamespaceResolver2.Add("", "http://xamarin.com/schemas/2014/forms"); xmlNamespaceResolver2.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml"); xmlNamespaceResolver2.Add("pages", "clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"); xmlNamespaceResolver2.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives"); xamlServiceProvider2.Add(typeFromHandle4, new XamlTypeResolver(xmlNamespaceResolver2, typeof(BusyPage).GetTypeInfo().Assembly)); xamlServiceProvider2.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(27, 21))); label.SetValue(fontSizeProperty, ((IExtendedTypeConverter)fontSizeConverter).ConvertFromInvariantString("Medium", (IServiceProvider)xamlServiceProvider2)); radBusyIndicator.SetValue(RadBusyIndicator.BusyContentProperty, label); VisualDiagnostics.RegisterSourceInfo(label, new Uri("Busy\\BusyPage.xaml", UriKind.RelativeOrAbsolute), 23, 18); stackLayout.Children.Add(radBusyIndicator); VisualDiagnostics.RegisterSourceInfo(radBusyIndicator, new Uri("Busy\\BusyPage.xaml", UriKind.RelativeOrAbsolute), 14, 10); busyPage.SetValue(ContentPage.ContentProperty, stackLayout); VisualDiagnostics.RegisterSourceInfo(stackLayout, new Uri("Busy\\BusyPage.xaml", UriKind.RelativeOrAbsolute), 11, 6); VisualDiagnostics.RegisterSourceInfo(busyPage, new Uri("Busy\\BusyPage.xaml", UriKind.RelativeOrAbsolute), 2, 2); }
private void AppendContent2(string storageName, UIElement elem, PinType pinType, RadBusyIndicator busyIndicator) { if (busyIndicator != null) { busyIndicator.Visibility = Visibility.Collapsed; busyIndicator.Background = null; busyIndicator.IsRunning = false; } DataModel.CategoryItem categoryItem = MiscHelpers.GetCatergoryItemFromIsolatedStorage(storageName + ".xml"); if (categoryItem == null) return; var configString = storageName.Replace("fbd-ctgy-", ""); configString = configString.Replace("fbd-localcache-", ""); configString = configString.Replace("fbd-prefetch-", ""); if (storageName.StartsWith("fbd-giant")) { configString = _configString; } var defaultPhoto = _cf[configString]["photo_default"]; var gridTitle = _cf[configString]["title"]; var feedItemList = categoryItem.ChannelItems; if (feedItemList != null) { var hubTile = elem as RadSlideHubTile; if (hubTile != null) { hubTile.Title = gridTitle; hubTile.Background = new ImageBrush { ImageSource = new BitmapImage(new Uri(defaultPhoto, UriKind.RelativeOrAbsolute)), Stretch = Stretch.UniformToFill }; hubTile.Tap += delegate { Analytics.GetInstance().TrackCategoryPageButtonPressed("tile", configString, "1"); if (!storageName.StartsWith("fbd-prefetch-")) { Dispatcher.BeginInvoke( () => NavigationService.Navigate( new Uri("/NewsListPage.xaml?category=" + configString + "&storage=" + storageName + "&viewtype=" + pinType, UriKind.Relative))); } }; } if (storageName.StartsWith("fbd-giant")) { return; } var homeTileList = MiscHelpers.GetItemFromIsolatedStorage<List<PinTile>>("fbd-pintiles.xml"); foreach (var item in feedItemList) { string[] ss = item.Tag.ToString().Split('|'); if (ss.Length > 2) { //Check if the channel context are available in isolated-stoage (Channel has been pinned) string channelName = ss[2]; string eachStorageName = "fbd-channel-" + channelName; var subscribeImage = Constant.SubscribeImageSource; if (HomePagePinTiles.IsFull()) { subscribeImage = Constant.FullSubscribeImageSource; } string f = HttpUtility.UrlEncode(eachStorageName) + ".xml"; var channelItem = MiscHelpers.GetChannelItemFromIsolatedStorage(f); if (channelItem == null) { channelItem = item; } else { //Change add icon to remove icon if true PinTile existingHomeTile = GeneralHelper.GetHomeTile(eachStorageName, homeTileList); if (existingHomeTile != null) { subscribeImage = Constant.UnSubscribeImageSource; } } var uItem = MiscHelpers.CreateUINewsItem(channelItem); string feedPhoto = "http://s2.googleusercontent.com/s2/favicons?domain=" + item.FeedLink; var imageB = new BitmapImage(new Uri(feedPhoto, UriKind.RelativeOrAbsolute)) { CreateOptions = BitmapCreateOptions.BackgroundCreation }; imageB.ImageOpened += delegate { uItem.NewsImageSource = imageB; }; var image = new BitmapImage(new Uri(defaultPhoto, UriKind.RelativeOrAbsolute)); uItem.NewsImageSource = image; uItem.SubscribeImageSource = subscribeImage; feedItems.Add(uItem); giantCategoryitem.ChannelItems.Add(channelItem); } } MiscHelpers.SaveDataToIsolatedStorage("fbd-giant.xml", giantCategoryitem, typeof(DataModel.CategoryItem), FileMode.Create); UIElementCollection uic = ContentPanel.Children; AppendContent2("fbd-giant", uic[0], PinType.Category, null); } }
public IndicatorManager(RadBusyIndicator indicator) { this.indicator = indicator; this.indicator.IsBusy = true; }
private void SetupCommandHanlder(object o) { if (this.count >= 15) return; var ucContentControl = new ucContentControlMedia(); var contentControl = ucContentControl.FindName("ContentControl") as ContentControl; this.busyIndicator = ucContentControl.FindName("BusyIndicator") as RadBusyIndicator; this.IsBusy = true; var mainGrid = this.View.FindName("MainGrid") as Grid; mainGrid.Children.Add(ucContentControl); Grid.SetRow(ucContentControl, this.count / 4); Grid.SetColumn(ucContentControl, this.count % 4); this.PlayVideoExpernally(contentControl); }