Format:
Recent snippets matching tags of wpf
<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()
15 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
<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>
51 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
using System; using System.Windows; using System.Windows.Controls; using System.Windows.Interactivity; using System.Windows.Threading; namespace Behaviors { /// <summary> /// On ListBoxes using CanContentScroll=True (virtualized), WPF layout changes will make the scrollviewer reset to zero.
95 Views
no comments
public static BitmapImage _ToBitmapImage(this Bitmap bitmap) { var _MemoryStream = new MemoryStream(); bitmap.Save(_MemoryStream, ImageFormat.Png); var _BitmapImage = new BitmapImage(); _BitmapImage.BeginInit(); _BitmapImage.StreamSource = _MemoryStream; _BitmapImage.EndInit();
94 Views
no comments
/// <summary> /// State flag which indicates whether the grid is in edit /// mode or not. /// </summary> public bool IsEditing { get; set; } private void OnBeginEdit(object sender, DataGridBeginningEditEventArgs e) { IsEditing = true; //in case we are in the middle of a drag/drop operation, cancel it...
154 Views
no comments
<Popup x:Name="popup1" IsHitTestVisible="False" Placement="RelativePoint" PlacementTarget="{Binding ElementName=me}" AllowsTransparency="True"> <Border BorderBrush="{DynamicResource CellBorderBrush}" BorderThickness="2" Background="White"
122 Views
no comments
<Style.Triggers> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Background" Value="#EEEEEE" /> </Trigger> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="HasItems" Value="false" /> <Condition Property="Width" Value="Auto" /> </MultiTrigger.Conditions>
194 Views
no comments
// DRAG private void List_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { // Store the mouse position startPoint = e.GetPosition(null); } private void List_MouseMove(object sender, MouseEventArgs e) {
447 Views
no comments
public class DelegateCommand : ICommand { private readonly Predicate<object> _canExecute; private readonly Action<object> _execute; public event EventHandler CanExecuteChanged; public DelegateCommand(Action<object> execute) : this(execute, null) {
204 Views
no comments
public class Button : ButtonBase { // The dependency property public static readonly DependencyProperty IsDefaultProperty; static Button() { // Register the property Button.IsDefaultProperty = DependencyProperty.Register(“IsDefault”, typeof(bool), typeof(Button), new FrameworkPropertyMetadata(false,
134 Views
no comments
using System; using System.Diagnostics; using System.Windows; using System.Windows.Media; public partial class MyWPFClass : Window { public MyWPFClass() { InitializeComponent(); PrintLogicalTree(0, this);
186 Views
no comments
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <DockPanel LastChildFill="True"> <Slider Name="MyZoomSlider" Minimum=".5" Maximum="20" Value="1" DockPanel.Dock="Top" /> <TextBlock Margin="5,5,0,5" DockPanel.Dock="Top" Text="{Binding ElementName=MyZoomSlider, Path=Value, StringFormat='Current Zoom: \{0:0.0\}%'}"/> <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"> <Rectangle Fill="Blue" Height="100" Width="100" Margin="10" HorizontalAlignment="Left" VerticalAlignment="Top"> <Rectangle.LayoutTransform> <ScaleTransform
317 Views
1 comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
