|
Ahh, I see. Well, you need to give the label you are interested in a name, and use TargetName in your style trigger setter to change the style. The actual style you have as the main style should be Button not Label.
|
|
|
|
|
Your trigger is applied to a label, not to the button. Because "IsMouseOver" is a property of an individual label, the other label on the button is not influenced.
Could you also provide the code of your button?
|
|
|
|
|
Hello,
I have a button which opens a popup. In my xaml code behind i use:
private void dropDownbtn_Click(object sender, RoutedEventArgs e)
{
MenuPopUp.StaysOpen = true;
MenuPopUp.IsOpen = true;
MenuPopUp.StaysOpen = false;
}
The thing is that i want to put this code into xaml using event trigger (click on button) and setter with binding element as menuPopUp and set it's properties.
Can i do it in xaml? i mean set the same property twice (once true and once false)? I mean for the statysOpen property.
BTW, i am doing this because otherwise popup will be opened and closed automatically on button click so popup will never be shown.
|
|
|
|
|
Hi Everyone,
Does anyone know how to snap polygon to another polygon edge or vertex when they closely? like this one
I already knew how to snap to grid lines,
but I have no idea how to snap polygon to polygon
I used C# and WPF.
Does anyone have any good ideas?? Thanks.
|
|
|
|
|
Hi iamnewguy,
I'm actually looking for the same functionnality, I had drag google without any good answers,
did you finaly manage to snap your polygons together ?
thank you !
|
|
|
|
|
Hi
In my WPF application i'm using an Entity Data Model to access data.
Whem my application start i load the connectionstring from a file and i pass it to the EntityDataModel trough its constructor.
SuiteStoreEntites issEntities = new SuiteStoreEntities(connectString);
The connection string parameter is :
metadata=res://*/Data.SuiteStoreModel.csdl|res://*/Data.SuiteStoreModel.ssdl|res://*/Data.SuiteStoreModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\\SQLEXPRESS;Initial Catalog=SuiteStore;Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFramework"
And i get the following error in the EntityDataModel's designer: Argument Exception Occured Keyword 'data source' is not supported.
public SuiteStoreEntities(string connectionString) : base(connectionString, "SuiteStoreEntities")
{ ... }
<pre>
<div class="signature">
</div>
|
|
|
|
|
in this statement.
connection string=;"Data Source=.\\SQLEXPRESS remove the ";".
connection string="Data Source=.\\SQLEXPRESS
To build a correct connection string look at this link.
connection string="Data Source=.\\SQLEXPRESS[^]
|
|
|
|
|
How I can understand how the principle of binding in WPF?
how I can connect things to do with the commands in MVVM pattern?
|
|
|
|
|
One of the easiest ways to get started in MVVM is with this[^] article. You can also get MVVM In The Box[^] training.
|
|
|
|
|
|
|
Hello,
I have a button which opens a popup.
I want the option - if user clicks in any place outside of this button or popup so it will be closed. otherwise it will be on screen.
How can i do it?
|
|
|
|
|
Try to grab focus and then when when the click event does not occur on the popup, close the popup.
To get the click event and check if the mouse pointer is not within the popup frame, use GetVisualDescendants .
|
|
|
|
|
how to use this GetVisualDescendants ?
|
|
|
|
|
|
|
Have a look here[^] for an example.
|
|
|
|
|
Hi,
Can anybody please tell me,
How I can move the expand collapse to the right hand side, instead of default left hand side ?? without changing the left side margin..
i mean tree view should be same as it is but the expand collapse only should move to right
|
|
|
|
|
Hi all,
I want to merge cells of a datagrid, using silverlight 4. How do I do?
Thank you very much for your attention.
|
|
|
|
|
|
Thank you very much. But I want to merge the cells which contains data, not the header. Can I do this with silverlight? Do you have any other suggestions?
|
|
|
|
|
Hello,
I have a popup which is opened on button click.
<Popup Name="MenuPopUp" IsOpen="False" PlacementTarget="{Binding ElementName=dropDownbtn}" Placement="Top" LostFocus="MenuPopUp_LostFocus" MouseLeftButtonDown="MenuPopUp_MouseLeftButtonDown">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<MenuItem Grid.Row="0" Name="ViewReportItem" Header="View Report" Command="{Binding ViewReportCommand}"/>
<MenuItem Grid.Row="1" Name="ExportReportItem" Header="Export Report" Command="{Binding ExportReportCommand}"/>
<MenuItem Grid.Row="2" Name="AbortReportItem" Header="Abort Report" Command="{Binding AbortReportCommand}"/>
</Grid>
</Popup>
I want the popup to stay on screen unless i click somewhere else in the UserControl.
This UserControl is small part of a big UserControl which is working using MVVM and PRISM
How can i do it?
|
|
|
|
|
Hello,
I have a button and a context menu on it.
I want to align the context menu to be opened on top of the button. I mean on the Upper Left corner of the button. How can i do it in XAML?
currently i use the code:
Button Grid.Column="1" BorderThickness="0" Name="dropDownbtn" Click="dropDownbtn_Click" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
<Image Source="/AQUA.ClientServices.Presentation;component/Images/dropDown.png" ClipToBounds="True" />
<Button.ContextMenu>
<ContextMenu BorderThickness="0" Name="LeftClickMenu" MouseLeave="LeftClickMenu_MouseLeave">
<MenuItem Name="ViewReportItem" Header="View Report" Command="{Binding ViewReportCommand}"/>
<MenuItem Name="ExportReportItem" Header="Export Report" Command="{Binding ExportReportCommand}"/>
<MenuItem Name="AbortReportItem" Header="Abort Report" Command="{Binding AbortReportCommand}"/>
</ContextMenu>
</Button.ContextMenu>
</Button>
|
|
|
|
|
The easiest way to do this is to use the ContextMenuService on the button itself. So, in your button definition, add ContextMenuService.Placement="Top"
|
|
|
|
|
OK.
Another issue is that this context menu opened on left mouse click on button.
But it never enters the can_execute .
But when i click Right Mouse Button it does enters can_execute.
How to solve it?
|
|
|
|