-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c73ea3
commit 4e526b1
Showing
6 changed files
with
86 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using OneWare.Shared.Controls; | ||
using OneWare.Shared.ViewModels; | ||
|
||
namespace OneWare.Core.Models; | ||
|
||
public class VirtualDialogModel | ||
{ | ||
public FlexibleWindow Dialog { get; } | ||
|
||
public VirtualDialogModel(FlexibleWindow dialog) | ||
{ | ||
Dialog = dialog; | ||
} | ||
|
||
public void Close() | ||
{ | ||
if(Dialog is {DataContext: FlexibleWindowViewModelBase vm}) | ||
vm.Close(Dialog); | ||
else Dialog.Close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Globalization; | ||
using Avalonia.Data.Converters; | ||
|
||
namespace OneWare.Shared.Converters | ||
{ | ||
public class AddConverter : IValueConverter | ||
{ | ||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) | ||
{ | ||
if (value == null || parameter == null) return false; | ||
if(!double.TryParse(parameter.ToString(), out var param)) return null; | ||
if(!double.TryParse(value.ToString(), out var val)) return null; | ||
return param + val; | ||
} | ||
|
||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters