Skip to content

Commit

Permalink
fix #339 attach monitor wont work
Browse files Browse the repository at this point in the history
  • Loading branch information
mgth committed May 19, 2024
1 parent b90d6af commit 955e033
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ public static bool SaveEnabled(this IMonitorsLayout @this)

if (@this.Options.LoadAtStartup) @this.Schedule(); else @this.Unschedule();

//@this.Saved = true;
return true;
}

Expand Down Expand Up @@ -324,7 +323,7 @@ public static void Load(this DisplaySource @this, RegistryKey key)

@this.Orientation = orientation;

@this.DisplayName = key.GetOrSet($@"{id}\DisplayName", () => @this.DisplayName);
// @this.DisplayName = key.GetOrSet($@"{id}\DisplayName", () => @this.DisplayName);

@this.Saved = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,13 @@ public DefaultMonitorViewModel()
(attached, primary) => attached && !primary)
.ToProperty(this, e => e.DetachVisible);

DetachCommand = ReactiveCommand.Create(() =>
{
DetachFromDesktop();
},this.WhenAnyValue(
DetachCommand = ReactiveCommand.Create(DetachFromDesktop,this.WhenAnyValue(
e => e.Attached,
e => e.Primary,
(attached,primary) => attached && !primary)
.ObserveOn(RxApp.MainThreadScheduler));

AttachCommand = ReactiveCommand.Create(() =>
{
AttachToDesktop();
},this.WhenAnyValue(e => e.Attached, e => !e).ObserveOn(RxApp.MainThreadScheduler));
AttachCommand = ReactiveCommand.Create(AttachToDesktop,this.WhenAnyValue(e => e.Attached, e => !e).ObserveOn(RxApp.MainThreadScheduler));
}

public bool Attached => _attached.Value;
Expand Down

0 comments on commit 955e033

Please sign in to comment.