Files
        @ 5e28ba3945f7
    
        
              Branch filter: 
        
    Location: ATITD-Tools/Desert-Paint-Codex/Views/WelcomeView.axaml.cs - annotation
        
            
            5e28ba3945f7
            1.5 KiB
            text/x-csharp
        
        
    
    Recipe count is now a ulong instead of an int so it can show values > 2.47 billion. Also, don't allow clearing the recipe list while the recipe generator is running.
    40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56 40eaee10ae56  | using System;
using System.Reactive.Disposables;
using Avalonia;
using Avalonia.Markup.Xaml;
using Avalonia.Platform;
using Avalonia.ReactiveUI;
using DesertPaintCodex.ViewModels;
using ReactiveUI;
namespace DesertPaintCodex.Views
{
    public class WelcomeView : ReactiveWindow<WelcomeViewModel>
    {
        public WelcomeView()
        {
            InitializeComponent();
#if DEBUG
            this.AttachDevTools();
#endif
            // Extract some reasonable screen defaults.
            IScreenImpl screenInfo = PlatformImpl.Screen;
            for (int i = 0; i < screenInfo.ScreenCount; i++)
            {
                Screen screen = screenInfo.AllScreens[i];
                if (!screen.Primary) continue;
                Util.Constants.DefaultScreenWidth  = screen.Bounds.Width;
                Util.Constants.DefaultScreenHeight = screen.Bounds.Height;
                Util.Constants.DefaultScreenX      = screen.Bounds.X;
                Util.Constants.DefaultScreenY      = screen.Bounds.Y;
                break;
            }
            
            // Make this window draggable.
            PointerPressed += (_, e) =>
            {
                PlatformImpl?.BeginMoveDrag(e);
            };
            
            // Handle the close command.
            this.WhenActivated(disposables=>
            {
                ViewModel?.FinishWelcome.Subscribe(_ => Close()).DisposeWith(disposables);
            });
        }
        
        private void InitializeComponent()
        {
            AvaloniaXamlLoader.Load(this);
        }
    }
}
 |