本文整理汇总了C#中System.Windows.EventSetter类的典型用法代码示例。如果您正苦于以下问题:C# EventSetter类的具体用法?C# EventSetter怎么用?C# EventSetter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventSetter类属于System.Windows命名空间,在下文中一共展示了EventSetter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: switch
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
System.Windows.EventSetter eventSetter;
switch (connectionId)
{
case 1:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.UIElement.MouseEnterEvent;
#line 7 "..\..\..\MainWindow.xaml"
eventSetter.Handler = new System.Windows.Input.MouseEventHandler(this.element_MouseEnter);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.UIElement.MouseLeaveEvent;
#line 8 "..\..\..\MainWindow.xaml"
eventSetter.Handler = new System.Windows.Input.MouseEventHandler(this.element_MouseLeave);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
}
}
示例2: switch
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
System.Windows.EventSetter eventSetter;
switch (connectionId)
{
case 1:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.UIElement.PreviewMouseUpEvent;
#line 82 "..\..\..\..\Views\Controls\RadialMenus.xaml"
eventSetter.Handler = new System.Windows.Input.MouseButtonEventHandler(this.RadialMenuItem_PreviewMouseUp);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.UIElement.PreviewMouseDownEvent;
#line 83 "..\..\..\..\Views\Controls\RadialMenus.xaml"
eventSetter.Handler = new System.Windows.Input.MouseButtonEventHandler(this.RadialMenuItem_PreviewMouseDown);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
}
}
示例3: switch
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
System.Windows.EventSetter eventSetter;
switch (connectionId)
{
case 1:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.FrameworkElement.LoadedEvent;
#line 265 "..\..\..\..\Styles\VS2012\VS2012WindowStyle.xaml"
eventSetter.Handler = new System.Windows.RoutedEventHandler(this.WindowLoaded);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
case 2:
#line 338 "..\..\..\..\Styles\VS2012\VS2012WindowStyle.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.MinButtonClick);
#line default
#line hidden
break;
case 3:
#line 358 "..\..\..\..\Styles\VS2012\VS2012WindowStyle.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.CloseButtonClick);
#line default
#line hidden
break;
}
}
示例4: switch
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
System.Windows.EventSetter eventSetter;
switch (connectionId)
{
case 1:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.Controls.Primitives.Selector.SelectionChangedEvent;
#line 5 "..\..\AddProductEventDictionary.xaml"
eventSetter.Handler = new System.Windows.Controls.SelectionChangedEventHandler(this.ChangeValue);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
case 2:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.Controls.Primitives.ButtonBase.ClickEvent;
#line 8 "..\..\AddProductEventDictionary.xaml"
eventSetter.Handler = new System.Windows.RoutedEventHandler(this.AddProduct);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
}
}
开发者ID:NikolovNikolay,项目名称:Telerik-Academy-Team-work-projects,代码行数:28,代码来源:AddProductEventDictionary.g.i.cs
示例5: switch
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
System.Windows.EventSetter eventSetter;
switch (connectionId)
{
case 1:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.UIElement.MouseLeftButtonDownEvent;
#line 9 "..\..\..\..\..\View\Resourses\Styles\FlatWindow.xaml"
eventSetter.Handler = new System.Windows.Input.MouseButtonEventHandler(this.Resize_Init);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.UIElement.MouseLeftButtonUpEvent;
#line 10 "..\..\..\..\..\View\Resourses\Styles\FlatWindow.xaml"
eventSetter.Handler = new System.Windows.Input.MouseButtonEventHandler(this.Resize_End);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.UIElement.MouseMoveEvent;
#line 11 "..\..\..\..\..\View\Resourses\Styles\FlatWindow.xaml"
eventSetter.Handler = new System.Windows.Input.MouseEventHandler(this.Resizeing_Form);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
case 2:
#line 37 "..\..\..\..\..\View\Resourses\Styles\FlatWindow.xaml"
((System.Windows.Controls.Grid)(target)).MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.TopBar_MouseDown);
#line default
#line hidden
break;
case 3:
#line 70 "..\..\..\..\..\View\Resourses\Styles\FlatWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnClose_Click);
#line default
#line hidden
break;
case 4:
#line 81 "..\..\..\..\..\View\Resourses\Styles\FlatWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnMinimize_Click);
#line default
#line hidden
break;
}
}
示例6: MouseButtonEventHandler
void IStyleConnector.Connect(int connectionId, object target) {
if (connectionId == 1) {
var item = new EventSetter {
Event = MouseDownEvent,
Handler = new MouseButtonEventHandler(ImageClicked)
};
((Style)target).Setters.Add(item);
}
}
示例7: switch
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
System.Windows.EventSetter eventSetter;
switch (connectionId)
{
case 1:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.FrameworkElement.LoadedEvent;
#line 55 "..\..\..\..\Styles\Window\VS2012WindowStyle.xaml"
eventSetter.Handler = new System.Windows.RoutedEventHandler(this.WindowLoaded);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
case 2:
#line 107 "..\..\..\..\Styles\Window\VS2012WindowStyle.xaml"
((System.Windows.Controls.Image)(target)).MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.IconMouseUp);
#line default
#line hidden
#line 108 "..\..\..\..\Styles\Window\VS2012WindowStyle.xaml"
((System.Windows.Controls.Image)(target)).MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.IconMouseLeftButtonDown);
#line default
#line hidden
break;
case 3:
#line 129 "..\..\..\..\Styles\Window\VS2012WindowStyle.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.MinButtonClick);
#line default
#line hidden
break;
case 4:
#line 149 "..\..\..\..\Styles\Window\VS2012WindowStyle.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.MaxButtonClick);
#line default
#line hidden
break;
case 5:
#line 170 "..\..\..\..\Styles\Window\VS2012WindowStyle.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.CloseButtonClick);
#line default
#line hidden
break;
}
}
示例8: AssignTo
/// <summary>
/// Attaches the TextBox selection behavior to a style from code-behind.
/// </summary>
public static void AssignTo(Style style)
{
if (style != null)
{
//<EventSetter Event="PreviewMouseDown" Handler="{Binding Source={StaticResource TextBoxSelectionHandler}, Path=TextBox_PreviewMouseDown}" />
//<EventSetter Event="LostMouseCapture" Handler="{Binding Source={StaticResource TextBoxSelectionHandler}, Path=TextBox_LostMouseCapture}" />
//<EventSetter Event="GotKeyboardFocus" Handler="{Binding Source={StaticResource TextBoxSelectionHandler}, Path=TextBox_GotKeyboardFocus}" />
var setter = new EventSetter(UIElement.PreviewMouseDownEvent, new MouseButtonEventHandler(TextBoxPreviewMouseDown));
style.Setters.Add(setter);
setter = new EventSetter(UIElement.LostMouseCaptureEvent, new MouseEventHandler(TextBoxLostMouseCapture));
style.Setters.Add(setter);
setter = new EventSetter(UIElement.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(TextBoxGotKeyboardFocus));
style.Setters.Add(setter);
}
}
示例9: switch
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
System.Windows.EventSetter eventSetter;
switch (connectionId)
{
case 1:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.Controls.Control.MouseDoubleClickEvent;
#line 47 "..\..\..\Views\PackageDatabaseTreeView.xaml"
eventSetter.Handler = new System.Windows.Input.MouseButtonEventHandler(this.HandleDoubleClick);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
}
}
示例10: switch
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
System.Windows.EventSetter eventSetter;
switch (connectionId)
{
case 1:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.Controls.Primitives.ButtonBase.ClickEvent;
#line 9 "..\..\App.xaml"
eventSetter.Handler = new System.Windows.RoutedEventHandler(this.EventSetter_Click);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
}
}
示例11: Mapper
public Mapper()
{
InitializeComponent();
//For interaction modes in Mapper.
InteractModes = new List<string> { "Mouse", "Stylus", "Gesture", "Stylus and Gesture" };
InteractionModeCombobox.ItemsSource = InteractModes;
InteractionModeCombobox.SelectedIndex = 0;
//style for values list box -> rule designer
Style valuesListboxStyle = new Style();
EventSetter esVSMouseDown = new EventSetter(ListBoxItem.PreviewMouseLeftButtonDownEvent, new MouseButtonEventHandler(ValueListBox_PreviewMouseDown));
EventSetter esVSMouseMove = new EventSetter(ListBoxItem.PreviewMouseMoveEvent, new MouseEventHandler(ValueListBox_PreviewMouseMove));
valuesListboxStyle.Setters.Add(esVSMouseDown);
valuesListboxStyle.Setters.Add(esVSMouseMove);
ValuesListBox.ItemContainerStyle = valuesListboxStyle;
RulesListBox.ItemsSource = Matches;
//style for defined rules list box
//Style rulesListboxStyle = new Style();
//EventSetter esMouseDown = new EventSetter(ListBoxItem.PreviewMouseLeftButtonDownEvent, new MouseButtonEventHandler(ListBoxItem_PreviewMouseDown));
//EventSetter esMouseMove = new EventSetter(ListBoxItem.PreviewMouseMoveEvent, new MouseEventHandler(ListBoxItem_MouseMove));
//rulesListboxStyle.Setters.Add(esMouseDown);
//rulesListboxStyle.Setters.Add(esMouseMove);
//RulesListBox.ItemContainerStyle = rulesListboxStyle;
suggestions = new ObservableCollection<Suggestion>();
SuggestionsListBox.ItemsSource = suggestions;
//set them to true
mapperSuggester = new Suggester();
//load functions toolbox
functionsToolBox = new Toolbox();
string functionsFile = "../../Resources/Functions.xml";
loadFunctionsToolbox(functionsFile, functionsToolBox);
FunctionsExpander.Content = functionsToolBox;
FunctionsExpander.IsExpanded = true;
//Logger
logger = new Logger("MapperLogger");
logsTab.Content = logger;
}
示例12: switch
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
System.Windows.EventSetter eventSetter;
switch (connectionId)
{
case 1:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.UIElement.MouseLeftButtonDownEvent;
#line 407 "..\..\..\..\Styles\Metro\WindowStyle.xaml"
eventSetter.Handler = new System.Windows.Input.MouseButtonEventHandler(this.MouseLeftButtonDown);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
case 2:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.FrameworkElement.LoadedEvent;
#line 415 "..\..\..\..\Styles\Metro\WindowStyle.xaml"
eventSetter.Handler = new System.Windows.RoutedEventHandler(this.WindowLoaded);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
case 3:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.FrameworkElement.LoadedEvent;
#line 534 "..\..\..\..\Styles\Metro\WindowStyle.xaml"
eventSetter.Handler = new System.Windows.RoutedEventHandler(this.WindowLoaded);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
}
}
示例13: switch
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
System.Windows.EventSetter eventSetter;
switch (connectionId)
{
case 2:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.Controls.Control.MouseDoubleClickEvent;
#line 1094 "..\..\MainWindow.xaml"
eventSetter.Handler = new System.Windows.Input.MouseButtonEventHandler(this.lvi_DoubleClick);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.UIElement.PreviewMouseLeftButtonDownEvent;
#line 1095 "..\..\MainWindow.xaml"
eventSetter.Handler = new System.Windows.Input.MouseButtonEventHandler(this.lv_playlist_MouseLeftButtonDown);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.UIElement.PreviewMouseLeftButtonUpEvent;
#line 1096 "..\..\MainWindow.xaml"
eventSetter.Handler = new System.Windows.Input.MouseButtonEventHandler(this.lv_playlist_MouseLeftButtonUp);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
}
}
示例14: switch
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
System.Windows.EventSetter eventSetter;
switch (connectionId)
{
case 3:
eventSetter = new System.Windows.EventSetter();
eventSetter.Event = System.Windows.Controls.Control.MouseDoubleClickEvent;
#line 138 "..\..\MainWindow.xaml"
eventSetter.Handler = new System.Windows.Input.MouseButtonEventHandler(this.OpenDownloadFolder);
#line default
#line hidden
((System.Windows.Style)(target)).Setters.Add(eventSetter);
break;
}
}
示例15: BuildWindowStyle
private Style BuildWindowStyle()
{
Style style = new Style(typeof(NotificationWindow));
if (action != null)
{
MouseButtonEventHandler doubleClickAction = (s, e) => action();
EventSetter leftMouseDoubleClick = new EventSetter(MouseDoubleClickEvent, doubleClickAction);
style.Setters.Add(leftMouseDoubleClick);
}
style.Setters.Add(new Setter(BackgroundProperty, Brushes.Black));
style.Setters.Add(new Setter(ForegroundProperty, Brushes.Transparent));
style.Setters.Add(new Setter(TopmostProperty, true));
style.Setters.Add(new Setter(FocusableProperty, false));
style.Setters.Add(new Setter(ShowInTaskbarProperty, false));
style.Setters.Add(new Setter(ShowActivatedProperty, false));
style.Setters.Add(new Setter(IsTabStopProperty, false));
style.Setters.Add(new Setter(ResizeModeProperty, ResizeMode.NoResize));
style.Setters.Add(new Setter(WindowStyleProperty, WindowStyle.None));
style.Setters.Add(new Setter(BorderThicknessProperty, new Thickness(0d)));
double top = SystemParameters.WorkArea.Top + 50;
double left = SystemParameters.WorkArea.Right - 475d - 100;
style.Setters.Add(new Setter(TopProperty, top));
style.Setters.Add(new Setter(LeftProperty, left));
style.Setters.Add(new Setter(SizeToContentProperty, SizeToContent.Height));
style.Setters.Add(new Setter(WidthProperty, 475d));
return style;
}