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
TextBox { | |
#Watermark(bindingPath: "Xaml", watermarkText: "Insert XAML here") | |
} | |
mixin Watermark(bindingPath, watermarkText) for TextBox { | |
Style: combine Style { | |
TargetType: TextBox | |
Triggers: [ | |
DataTrigger { | |
Binding: bind $bindingPath convert (string str) => string.IsNullOrEmpty(str) |
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
alias MyTextBox(text) { | |
TextBox { | |
} | |
} | |
Window "Ammy.Test.Workbench.MainWindow" { | |
@MyTextBox("2") { | |
PreviewTextInput: "NumberValidationTextBox" | |
Text: bind CustomWidth |
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
mixin Centered() : FrameworkElement { | |
HorizontalAlignment: Center | |
} | |
mixin Header() { | |
TextBlock { FontSize: 16 } | |
} | |
TextBlock { | |
@Centered() |
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
map syntax ShowSyntax.Top -> Top { | |
| WithoutNode -> TopWithoutNode { | |
Usings -> Usings; | |
Templates -> Templates; | |
} | |
| WithNode -> TopWithNode { | |
Usings -> Usings; | |
Node -> TopNode; | |
Templates -> Templates; |
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
mutable adders; | |
c.Scope.FindMany(s => true, ref adders); | |
foreach (adder in adders) { | |
def parms = adder.ParameterScope | |
.GetSymbols() | |
.OfType.[FormalParameterSymbol]() | |
.ToArray(); | |
when (parms.Length != 1) continue; |
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
syntax Expr | |
{ | |
| MemberRef = Key=QualifiedReference | |
| ArrayRef = Key=QualifiedReference "[" Expr "]" | |
| MethodCall = Key=QualifiedReference "(" (Argument; "," sm)* ")" | |
| Braces = "(" Expr ")" | |
| Complex = (MethodCall | MemberRef | ArrayRef | Braces) "." Expr | |
} |
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
namespace Nitra.Visualizer.ViewModels | |
{ | |
public class AstNodeViewModel : ReactiveObject | |
{ | |
readonly ObjectDescriptor _objectDescriptor; | |
readonly NitraClient _client; | |
[Reactive] | |
public bool NeedLoadContent { get; private set; } | |
public ReactiveList<AstNodeViewModel> Items { get; set; } |
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
Observable.Interval(TimeSpan.FromSeconds(2)) | |
.Delay(TimeSpan.FromSeconds(1)) | |
.ObserveOnDispatcher() | |
.Subscribe(_ => ((Storyboard)Resources["FadeIn"]).Begin()); | |
Observable.Interval(TimeSpan.FromSeconds(2)) | |
.ObserveOnDispatcher() | |
.Subscribe(_ => ((Storyboard)Resources["FadeOut"]).Begin()); |
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
<Window x:Class="WpfApplication1.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:local="clr-namespace:WpfApplication1" | |
mc:Ignorable="d" | |
Title="MainWindow" Height="350" Width="525"> | |
<Window.Resources> | |
<Storyboard x:Key="FadeIn" TargetName="TestButton"> |
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
allMessages.GroupBy(msg => msg.Type) | |
.Select(g => g.Throttle(TimeSpan.FromSeconds(0.5)) // Ждём паузы между сообщениями | |
.Select(msg => HandleMessage(msg)) // HandleMessage возвращает Task<Result> | |
.Switch() // Если придёт новое сообщение этого типа, то старый ответ будет игнорирован | |
.SelectMany(res => SendResponse(res))) | |
.Subscribe() |