Пример #1
0
 /// <summary>
 /// Converts this OverlayWindow structure to a human-readable string.
 /// </summary>
 /// <returns>A string representation of this OverlayWindow.</returns>
 public override string ToString()
 {
     return(OverrideHelper.ToString(
                "Handle", Handle.ToString("X"),
                "IsInitialized", IsInitialized.ToString(),
                "IsVisible", IsVisible.ToString(),
                "IsTopmost", IsTopmost.ToString(),
                "X", X.ToString(),
                "Y", Y.ToString(),
                "Width", Width.ToString(),
                "Height", Height.ToString()));
 }
Пример #2
0
    public FileControl()
    {
        this.InitializeComponent();

        this.WhenActivated(disposables =>
        {
            this.WhenAnyValue(v => v.ViewModel)
            .BindTo(this, v => v.DataContext)
            .DisposeWith(disposables);

            this.OneWayBind(this.ViewModel, vm => vm.Content, v => v.Host.ViewModel)
            .DisposeWith(disposables);

            Observable.FromEventPattern <NavigationViewItemInvokedEventArgs>(
                h => this.Navigation.ItemInvoked += h, h => this.Navigation.ItemInvoked -= h)
            .Select(e => e.EventArgs.InvokedItemContainer)
            .DistinctUntilChanged()
            .Select(item => item == this.ListItem
                    ? this.ViewModel !.SwitchToList
                    : this.ViewModel !.SwitchToSettings)
            .SubscribeAsync(command => command.Execute())
            .DisposeWith(disposables);

            this.WhenAnyValue(v => v.ViewModel !.Content)
            .WhereNotNull()
            .DistinctUntilChanged()
            .Select(content => content switch
            {
                FileMainContentViewModel => this.ListItem,
                _ => this.Navigation.SettingsItem
            })
            .BindTo(this, v => v.Navigation.SelectedItem)
            .DisposeWith(disposables);

            this.ViewModel !.IsInitialized
            .Where(isInitialized => isInitialized)
            .Select(_ => this.ListItem)
            .Take(1)
            .BindTo(this, v => v.Navigation.SelectedItem)
            .DisposeWith(disposables);
        });
Пример #3
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     return(IsInitialized.GetHashCode() ^ IsSealed.GetHashCode() ^ IsStandby.GetHashCode());
 }
Пример #4
0
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>A 32-bit signed integer hash code.</returns>
 public override int GetHashCode()
 {
     return(OverrideHelper.HashCodes(
                IsInitialized.GetHashCode(),
                Handle.GetHashCode()));
 }