public static void Show(Form owner, LoadingStyle style, Action <LoadingArgs> action) { LoadingHandler lh = new LoadingHandler(); lh.Style = style; lh.Load(owner, action); }
private void ApplyLoadingStyle() { _loadingStyle = StylesManager.GetRandomLoadingStyle(); if (_loadingStyle.ForegroundImageUri != null) { loadingForegroundImage.Source = new BitmapImage( _loadingStyle.ForegroundImageUri); connectionFailedForegroundImage.Source = new BitmapImage( _loadingStyle.ForegroundImageUri); loadingForegroundImage.Visibility = Visibility.Visible; connectionFailedForegroundImage.Visibility = Visibility.Visible; } else { loadingForegroundImage.Source = null; connectionFailedForegroundImage.Source = null; loadingForegroundImage.Visibility = Visibility.Hidden; connectionFailedForegroundImage.Visibility = Visibility.Hidden; } if (_loadingStyle.BackgroundImageUri != null) { loadingBackgroundImage.Source = new BitmapImage( _loadingStyle.BackgroundImageUri); connectionFailedBackgroundImage.Source = new BitmapImage( _loadingStyle.BackgroundImageUri); loadingBackgroundImage.Visibility = Visibility.Visible; connectionFailedBackgroundImage.Visibility = Visibility.Visible; } else { loadingBackgroundImage.Source = null; connectionFailedBackgroundImage.Source = null; loadingBackgroundImage.Visibility = Visibility.Hidden; connectionFailedBackgroundImage.Visibility = Visibility.Hidden; } loadingIndicator.HorizontalAlignment = _loadingStyle.LoadingIndicatorHorizontalAlignment; loadingIndicator.VerticalAlignment = _loadingStyle.LoadingIndicatorVerticalAlignment; connectionFailedIndicator.HorizontalAlignment = _loadingStyle.LoadingIndicatorHorizontalAlignment; connectionFailedIndicator.VerticalAlignment = _loadingStyle.LoadingIndicatorVerticalAlignment; }
private void CreateAttrLayout() { textLabel[2] = new TextLabel(); textLabel[2].PointSize = 20; textLabel[2].HorizontalAlignment = HorizontalAlignment.Center; textLabel[2].VerticalAlignment = VerticalAlignment.Center; textLabel[2].BackgroundColor = Color.Magenta; textLabel[2].Text = "Attribute construction"; gridLayout.Add(textLabel[2]); // layout for loading which is created by attributes. // It'll update the visual when framerate is changed, so put loading into a layout. layout[2] = new View(); layout[2].Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Horizontal, LinearAlignment = LinearLayout.Alignment.Center }; LoadingStyle style = new LoadingStyle { Images = imageArray }; loading[1] = new Loading(style); loading[1].Size = new Size(100, 100); layout[2].Add(loading[1]); gridLayout.Add(layout[2]); // layout for button. // To avoid button size same as the grid cell. layout[3] = new View() { }; layout[3].Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Horizontal, LinearAlignment = LinearLayout.Alignment.Center }; button[2] = new Button(); button[2].Size = new Size(400, 50); button[2].Text = "Normal Loading"; button[2].PointSize = 15; button[2].BackgroundColor = Color.Green; layout[3].Add(button[2]); gridLayout.Add(layout[3]); button[2].Focusable = true; FocusManager.Instance.SetCurrentFocusView(button[2]); }
public void Activate() { Window window = NUIApplication.GetDefaultWindow(); root = new View() { Size2D = new Size2D(1920, 1080), }; CreateBoardAndButtons(); string[] imageArray = new string[36]; for (int i = 0; i < 36; i++) { if (i < 10) { imageArray[i] = CommonResource.GetFHResourcePath() + "9. Controller/Loading Sequence_Native/loading_0" + i + ".png"; } else { imageArray[i] = CommonResource.GetFHResourcePath() + "9. Controller/Loading Sequence_Native/loading_" + i + ".png"; } } loading1_1 = new Loading(); loading1_1.Position2D = new Position2D(100, 350); loading1_1.Size2D = new Size2D(100, 100); loading1_1.Images = imageArray; root.Add(loading1_1); LoadingStyle style = new LoadingStyle { Images = imageArray }; loading2_1 = new Loading(style); loading2_1.Position2D = new Position2D(500, 350); loading2_1.Size2D = new Size2D(100, 100); root.Add(loading2_1); window.Add(root); FocusManager.Instance.SetCurrentFocusView(button1); }
public LoadingForm(LoadingStyle style) { InitializeComponent(); Style = style; }