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
<ListBox ItemsSource="{Binding MyDataSource}"> | |
<ListBox.ItemTemplate> | |
<DataTemplate> | |
<TextBlock Text="{Binding MySourceItemName}"> | |
<TextBlock.InputBindings> | |
<MouseBinding MouseAction="LeftDoubleClick" | |
Command="{Binding DataContext.MyCommand, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}" | |
CommandParameter="{Binding MySourceItemId}" /> | |
</TextBlock.InputBindings> | |
</TextBlock> |
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
private void Application_Startup(object sender, StartupEventArgs e) | |
{ | |
if (SingleInstance.IsFirstInstance) | |
{ | |
SingleInstance.ArgumentsReceived += SingleInstanceParameter; | |
SingleInstance.ListenForArgumentsFromSuccessiveInstances(); | |
// Do your other app logic | |
} | |
else | |
{ |
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
string data = | |
@"1941.1981.1080p.WEB-DL.x264.AC3-EVO.mkv | |
The.Voices.2014.720p.BDRip.x264.AC3-WiNTeaM.avi | |
13.Sins.2014.1080p.BluRay.DTS.x264-HDS.mkv | |
A.Million.Ways.to.Die.in.the.West.2014.1080p.WEB-DL.x264.AC3-EVO.mkv | |
Ant-Man.2015.1080p.BluRay.x264-SPARKS.mkv"; | |
string pattern = @" | |
^(?<Name>.+?) # Movie Name up to year and resolution |
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
String[] data = { | |
"showname.s01e01e02e03.extension", | |
"showname.s01e01-02-03.extension", | |
}; | |
Pattern p = Pattern.compile( | |
"[.]s(?<season>\\d{1,4})e(?<episodes>\\d{1,3}([e-]\\d{1,3})+)[.]", | |
Pattern.CASE_INSENSITIVE); | |
for (String input : data){ | |
Matcher m = p.matcher(input); | |
while (m.find()){ |
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
<Border BorderThickness="10" Height="100" Width="100" > | |
<Border.Resources> | |
<Style TargetType="Border"> | |
<Setter Property="BorderBrush"> | |
<Setter.Value> | |
<LinearGradientBrush> | |
<GradientStop Color="Yellow" Offset="0.0" /> | |
<GradientStop Color="Red" Offset="0.5" /> | |
<GradientStop Color="Yellow" Offset="1.0" /> | |
</LinearGradientBrush> |
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
<Storyboard x:Key="NewContentStoryboard"> | |
<PointAnimation Storyboard.TargetProperty="OpacityMask.(LinearGradientBrush.StartPoint)" From="0.5 0" To="0 0.5" Duration="00:00:1" /> | |
<PointAnimation Storyboard.TargetProperty="OpacityMask.(LinearGradientBrush.EndPoint)" From="1 0.5" To="0 0.5" Duration="00:00:1"/> | |
</Storyboard> |
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.Resources> | |
<Style TargetType="{x:Type ListBoxItem}"> | |
<Style.Triggers> | |
<Trigger Property="ItemsControl.AlternationIndex" Value="0"> | |
<Setter Property="Background" Value="#19f39611"></Setter> | |
</Trigger> | |
<Trigger Property="ItemsControl.AlternationIndex" Value="1"> | |
<Setter Property="Background" Value="#19000000"></Setter> | |
</Trigger> | |
</Style.Triggers> |
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.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Media; | |
namespace ReflectionControlProject | |
{ | |
public class ReflectionControl : Decorator | |
{ | |
private VisualBrush _reflection; |
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.Windows.Data; | |
namespace Converters | |
{ | |
public class PercentageConverter : IValueConverter | |
{ | |
public object Convert(object value, | |
Type targetType, | |
object parameter, |