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
101 ICON "Resources/app.ico" | |
102 ICON "Resources/second.ico" | |
201 24 "app.manifest" <- optional |
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
<Project Sdk="Microsoft.NET.Sdk"> | |
... | |
<Target Name="CopyPagesToOutputDirectory" AfterTargets="Build"> | |
<!-- Copy all 'Page' files with 'CopyToOutputDirectory' setting --> | |
<Copy SourceFiles="@(Page)" DestinationFolder="$(OutputPath)%(RelativeDir)" | |
Condition="'%(Page.CopyToOutputDirectory)' == 'Always'" /> | |
</Target> | |
... | |
</Project |
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
using System.Windows.Markup; | |
#if NET8_0 | |
[assembly: XmlnsDefinition("http://schemas.custom.com/net8/xaml", "KsWare.Presentation.Themes.Core.Net8")] | |
#endif | |
namespace KsWare.Presentation.Themes.Core.Net8 {class Dummy{} } |
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
public override string ToString() => | |
string.Create(null, stackalloc char[256], $"Type={GetType().Name}"); |
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
public static class Utils { | |
public static object? Default(Type type) { | |
return Type.GetTypeCode(type) switch { | |
TypeCode.Boolean => false, | |
TypeCode.String => null, | |
TypeCode.Char => '\0', | |
TypeCode.SByte => (sbyte)0, TypeCode.Byte => (byte)0, TypeCode.Int16 => (short)0, | |
TypeCode.UInt16 => (ushort)0, TypeCode.Int32 => 0, TypeCode.UInt32 => (uint)0, | |
TypeCode.Int64 => (long)0, TypeCode.UInt64 => (ulong)0, | |
TypeCode.Single => 0.0f, TypeCode.Double => 0.0d, TypeCode.Decimal => 0m, |
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
public partial class PopupWindow : Window { | |
public PopupWindow() { | |
InitializeComponent(); | |
WindowStartupLocation = WindowStartupLocation.Manual; | |
Loaded += (s, e) => { // HACK1: use Loaded | |
Mouse.Capture(this); // HACK2: use Capture | |
var p = PointToScreen(Mouse.GetPosition(this)); | |
Mouse.Capture(null); |
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
// SOURCE: https://gist.github.com/SchreinerK/299093195aebf1d3ef0d413659255c0d | |
using System; | |
using System.Collections; | |
using System.Globalization; | |
using System.Windows; | |
using System.Windows.Data; | |
// ReSharper disable once CheckNamespace | |
namespace KsWare.Presentation { |
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
// GIST: https://gist.github.com/SchreinerK/0aa450669ba0f66dbf821f92b15c1a66 | |
using System.Windows; | |
using System.Windows.Data; | |
using System.Windows.Input; | |
using KsWare.Presentation.ViewFramework; | |
// ReSharper disable once CheckNamespace | |
namespace KsWare.Presentation.Input { |
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
using System; | |
using System.Collections.Generic; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace KsWare.Threading { | |
public static class AsyncHelper { | |
public static Task<TResult> RunAsync<TResult>(Func<TResult> func) => Task.Run<TResult>(() => func()); |
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
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
namespace Common { | |
public sealed class PropertyChangedDistributor: IDisposable { | |
private readonly INotifyPropertyChanged _obj; | |
private readonly Dictionary<string, List<Entry>> _subscriptions = new Dictionary<string, List<Entry>>(); |
NewerOlder