CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
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()
by DaveCS   May 15, 2012 @ 7:52am
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}}}"/>
by DaveCS   April 14, 2012 @ 8:53pm
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)
by DaveCS   April 10, 2012 @ 6:53pm
39 Views
no comments
 
 
 
Dim fullExeNameAndPath As String = System.Reflection.Assembly.GetExecutingAssembly().Location
Dim ExeName As String = System.IO.Path.GetFileNameWithoutExtension(fullExeNameAndPath)
msgbox (ExeName)
by DaveCS   March 26, 2012 @ 8:01pm
35 Views
no comments
 
Dim rootWindow As MainWindow = TryCast(Application.Current.MainWindow, MainWindow)
       rootWindow.TabControl1.SelectedIndex = 4
by DaveCS   March 14, 2012 @ 5:27am
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)
by DaveCS   March 13, 2012 @ 7:03pm
45 Views
no comments
 
XML
SelectedItem="{Binding TheProperty, PresentationTraceSources.TraceLevel=High}"
by patrick   March 12, 2012 @ 5:46am
38 Views
no comments
 
C#
public partial class MainPage : PhoneApplicationPage
{
    // Constructor
    public MainPage()
    {
        InitializeComponent();
 
        // setup
        var _Button = (this.ApplicationBar.Buttons[0] as ApplicationBarIconButton);
        _Button.IsEnabled = Settings.AllowSave;
by Jerry Nixon   March 05, 2012 @ 10:51am
Tags: WP7
116 Views
no comments
 
XML
<DataGrid.Resources>
    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FFFFFF"/>
    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="#000000"/>
</DataGrid.Resources>
by patrick   March 05, 2012 @ 6:13am
29 Views
no comments
 
XML
<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>
by patrick   March 02, 2012 @ 1:30am
49 Views
no comments
 
C#
public class AppBootstrapper : Bootstrapper<IShell>
    {
        private IKernel mKernel;
        private const string EXTENSION_PATH = "extensions";
 
        static AppBootstrapper()
        {
            //Caliburn.Micro.LogManager.GetLog = type => new NLogLogger(type);
        }
by patrick   February 21, 2012 @ 2:10am
83 Views
no comments
 
C#
Microphone m_Microphone = Microphone.Default;
SoundEffectInstance m_Playback;
MemoryStream m_Sound = new MemoryStream();
byte[] m_Chunk;
 
public MainPage()
{
    InitializeComponent();
 
    m_Microphone.BufferReady += (s, e) =>
by Jerry Nixon   February 13, 2012 @ 12:59pm
154 Views
1 comments
 
C#
public partial class MainPage : PhoneApplicationPage
{
    // Constructor
    public MainPage()
    {
        InitializeComponent();
        MyListBox.ItemsSource = new string[] { "Red", "Green", "Blue" };
    }
 
    private void MyListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
by Jerry Nixon   January 19, 2012 @ 1:37pm
Tags: WP, Tiles
142 Views
no comments
 
C#
ObservableCollection<string> m_Data;
public MainPage()
{
    InitializeComponent();
    m_Data = new ObservableCollection<string>
    {
        "One", "Two", "Three", "Four"
    };
    MyListBox.ItemsSource = m_Data;
}
by Jerry Nixon   January 19, 2012 @ 8:53am
Tags: WP, XAML, Animation
86 Views
no comments
 
C#
ObservableCollection<string> m_Data;
public MainPage()
{
    InitializeComponent();
    m_Data = new ObservableCollection<string> 
    { 
        "One", "Two", "Three", "Four"
    };
    MyListBox.ItemsSource = m_Data;
}
by Jerry Nixon   January 19, 2012 @ 8:52am
Tags: WP, XAML, Animation
63 Views
no comments
 
C#
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)
by Jerry Nixon   January 10, 2012 @ 4:07pm
87 Views
no comments
 
C#
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()
by Jerry Nixon   January 06, 2012 @ 3:24pm
Tags: WP7, Info Hub
237 Views
1 comments
 
C#
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,
by Jerry Nixon   January 04, 2012 @ 9:06am
Tags: Animation, WP7
103 Views
no comments
 
C#
public ItemViewer()
{
    InitializeComponent();
    Loaded += ItemViewer_Loaded;
}
 
void ItemViewer_Loaded(object sender, RoutedEventArgs e)
{
    if (LayoutRoot.Visibility != Visibility.Collapsed)
        throw new Exception("item.Visibility != Collapsed");
by Jerry Nixon   January 03, 2012 @ 5:06pm
Tags: WP7, Animate
165 Views
no comments
 
C#
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);
}
by Jerry Nixon   January 03, 2012 @ 3:42pm
Tags: WP7, ANimation
116 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate