Format:
Recent snippets matching tags of WP
<Image Margin="367.056,8,8,0" VerticalAlignment="Top" Name="imgLargePreview" Width="640" Height="480" MaxHeight="480" MaxWidth="640" /> Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click saveImage() End Sub Sub saveImage() Dim encoder = New PngBitmapEncoder()
14 Views
no comments
'Xaml <DataTemplate x:Key="DataTemplateComboDrives"> <Grid Width="Auto"> <TextBlock x:Name="textBlockDriveName" Margin="8,8,0,8" TextWrapping="Wrap" Text="{Binding DriveName}" FontWeight="Bold" Foreground="{DynamicResource brushDarkBlueText}" HorizontalAlignment="Left" Width="23"/> <TextBlock x:Name="textBlockDriveLable" Margin="26,8,24,8" TextWrapping="Wrap" Text="{Binding DriveLable}" FontWeight="Bold" Foreground="{DynamicResource brushDarkBlueText}" RenderTransformOrigin="1.25,0.501" HorizontalAlignment="Right" Width="Auto"/> </Grid> </DataTemplate> <Style x:Key="ComboBoxItemStyleDrives" TargetType="{x:Type ComboBoxItem}"> <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/> <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
23 Views
no comments
'must have a legitimate email setup with smtp relays set greater than 0 in your godaddy control panel (email accounts) Private Sub btnSendMessage_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles btnSendMessage.Click CreateTimeoutTestMessage("smtpout.secureserver.net") 'This is standard with most email relays at godaddy End Sub Public Shared Sub CreateTimeoutTestMessage(server As String) Dim [to] As String = "busted@fbi.gov" Dim from As String = "billyjoebob@hillbilly.com" Dim subject As String = "Catch Me If You Can." Dim body As String = "This is the body of the message. Yada Yada Yada" Dim message As New MailMessage(from, [to], subject, body)
39 Views
no comments
Dim fullExeNameAndPath As String = System.Reflection.Assembly.GetExecutingAssembly().Location Dim ExeName As String = System.IO.Path.GetFileNameWithoutExtension(fullExeNameAndPath) msgbox (ExeName)
35 Views
no comments
Dim rootWindow As MainWindow = TryCast(Application.Current.MainWindow, MainWindow) rootWindow.TabControl1.SelectedIndex = 4
52 Views
no comments
Imports System.ComponentModel Public Class MyData Implements INotifyPropertyChanged ''USAGE in code behind 'Dim data1 As New MyData(DateTime.Now) 'Dim binding1 As New Binding("MyDataProperty") ' binding1.Source = data1 ' Me.txtEnterCode.SetBinding(TextBox.TextProperty, binding1)
45 Views
no comments
SelectedItem="{Binding TheProperty, PresentationTraceSources.TraceLevel=High}"
38 Views
no comments
public partial class MainPage : PhoneApplicationPage { // Constructor public MainPage() { InitializeComponent(); // setup var _Button = (this.ApplicationBar.Buttons[0] as ApplicationBarIconButton); _Button.IsEnabled = Settings.AllowSave;
116 Views
no comments
<DataGrid.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FFFFFF"/> <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="#000000"/> </DataGrid.Resources>
29 Views
no comments
<Application x:Class="MyApp.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:MyApp"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary> <local:AppBootstrapper x:Key="bootstrapper" /> </ResourceDictionary>
49 Views
no comments
public class AppBootstrapper : Bootstrapper<IShell> { private IKernel mKernel; private const string EXTENSION_PATH = "extensions"; static AppBootstrapper() { //Caliburn.Micro.LogManager.GetLog = type => new NLogLogger(type); }
83 Views
no comments
Microphone m_Microphone = Microphone.Default; SoundEffectInstance m_Playback; MemoryStream m_Sound = new MemoryStream(); byte[] m_Chunk; public MainPage() { InitializeComponent(); m_Microphone.BufferReady += (s, e) =>
154 Views
1 comments
public partial class MainPage : PhoneApplicationPage { // Constructor public MainPage() { InitializeComponent(); MyListBox.ItemsSource = new string[] { "Red", "Green", "Blue" }; } private void MyListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
142 Views
no comments
ObservableCollection<string> m_Data; public MainPage() { InitializeComponent(); m_Data = new ObservableCollection<string> { "One", "Two", "Three", "Four" }; MyListBox.ItemsSource = m_Data; }
86 Views
no comments
ObservableCollection<string> m_Data; public MainPage() { InitializeComponent(); m_Data = new ObservableCollection<string> { "One", "Two", "Three", "Four" }; MyListBox.ItemsSource = m_Data; }
63 Views
no comments
public class MatchConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo c) { if (value == null && Match == null) return Then; // convert Match to the value's type if (Match != null && value != null)
87 Views
no comments
public sealed class InfoHub: INotifyPropertyChanged { /* VERSION 1.0 // 2012.01.06 // blog.jerrynixon.com */ /* SEND UPDATES/BUGS/SUGGESTIONS TO jnixon@microsoft.com */ public enum Theme { Light, Dark } public enum Version { Nodo, Mango, Tango, Apollo, Unkown } public enum Accent { Blue, Pink, Brown, Purple, Green, Red, Lime, Teal, Magenta, Mango, Other } // used for the blocking Load()
237 Views
1 comments
static void Delete(PhoneApplicationPage page, UIElement item, Action callback) { // setup var _Scale = new ScaleTransform { ScaleX = 1, ScaleY = 1, CenterX = item.RenderSize.Width / 2, CenterY = item.RenderSize.Height / 2,
103 Views
no comments
public ItemViewer() { InitializeComponent(); Loaded += ItemViewer_Loaded; } void ItemViewer_Loaded(object sender, RoutedEventArgs e) { if (LayoutRoot.Visibility != Visibility.Collapsed) throw new Exception("item.Visibility != Collapsed");
165 Views
no comments
private void MyListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { // get the ListBoxItem that was pressed var _UIElement = MyListBox.ItemContainerGenerator .ContainerFromItem(MyListBox.SelectedItem) as UIElement; // resize the ListBoxItem Resize(_UIElement, () => { /* TODO: nav away */ }, 1, .25, .1); }
116 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
