This file contains hidden or 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 unsafe byte[] Fill(this byte[] array, int offset, int length, byte value) | |
{ | |
if ((length <= 0) || (array == null)) | |
{ | |
return array; | |
} | |
fixed (byte* pSrc = &array[offset]) | |
{ | |
*pSrc = value; |
This file contains hidden or 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="WpfApp.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:WpfApp" | |
mc:Ignorable="d" | |
Title="MainWindow" Height="350" Width="525"> | |
<StackPanel> | |
<Label Content="{Binding Path=Content.(local:ViewProperty.Title), Mode=OneWay, Source={x:Reference Container}}"/> |
This file contains hidden or 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.Reflection; | |
using System.Reflection.Emit; | |
public static class DynamicActivatorFactory | |
{ | |
private static readonly AssemblyBuilder AssemblyBuilder = AssemblyBuilder.DefineDynamicAssembly( | |
new AssemblyName("DynamicActivator"), | |
AssemblyBuilderAccess.Run); |
This file contains hidden or 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.ComponentModel; | |
using System.Windows; | |
using System.Windows.Interactivity; | |
[TypeConstraint(typeof(FrameworkElement))] | |
public class UpdateTargetAction : TriggerAction<FrameworkElement> | |
{ | |
public static readonly DependencyProperty PropertyNameProperty = | |
DependencyProperty.Register(nameof(PropertyName), typeof(string), typeof(UpdateTargetAction)); |
NewerOlder