xaml

How to achieve click event via dependency property in silverlight?

廉价感情. 提交于 2021-01-28 06:15:36
问题 I'm fairly new to the world of Silverlight so please bear with me. I have created a custom pivot item control to be displayed in a pivot control. Now in this custom control there's a button. Now i could just add the click event handler to the button in the custom control's backing cs file and that would be ok. But is there a way for me to specify the event handler of the custom control's button during the declaration of the custom control? i.e. something like this in my pivot_page.xaml

Problems adding an ObjectDataProvider in resources

荒凉一梦 提交于 2021-01-28 06:01:04
问题 I'm setting up some things in XAML, but for some reason, I'm having an issue. I'm trying to add an ObjectDataProvider to my resources, but when I'm doing that, I get this warning on my resourcedictionnary saying i cannot have multiple items in a resourcedictionnary if they don't all have key attribute in it. So I add a key to resourcedictionnary, but then I have a problem on my dynamic resource in my contentcontrol. It says it cannot resolve "DefaultEmptyPane". Then I add a reference to the

Accessing a control which is in a contentpresenter in c#

a 夏天 提交于 2021-01-28 05:00:17
问题 How to access a named control that is in the content template of the contentpresenter. how to access the webview control(x:name=detView) from cs file. <ContentPresenter x:Name="DetailContentPresenter" Grid.Row="0" BorderBrush="{ThemeResource SystemControlForegroundBaseLowBrush}" Content="{x:Bind coll.SelectedItem,Mode=OneWay}"> <ContentPresenter.ContentTemplate> <DataTemplate x:DataType="data:coll_Details" x:Name="ttt"> <Grid> <WebView DefaultBackgroundColor="#F5F5F5" x:Name="detView" Source=

Binding to a property in another namespace?

穿精又带淫゛_ 提交于 2021-01-28 04:31:00
问题 I've got a style setter in a themes xaml file. I'm trying to bind the value of the Setter to a bool peoperty in a view model. I've got the namespace to the view model in themes: xmlns:propertyGrid="clr-namespace:MY.App.Controls.PropertyGrid;assembly=MY.APP.Controls" and the binding in the style: <Setter Property="IsExpanded" Value="{Binding Source={StaticResource propertyGrid:PropertyGridViewModel}, Path=AreCategoriesAutoExpanded}"/> Finally in the viewmodel I just have an auto property:

Binding to a property in another namespace?

梦想的初衷 提交于 2021-01-28 04:28:53
问题 I've got a style setter in a themes xaml file. I'm trying to bind the value of the Setter to a bool peoperty in a view model. I've got the namespace to the view model in themes: xmlns:propertyGrid="clr-namespace:MY.App.Controls.PropertyGrid;assembly=MY.APP.Controls" and the binding in the style: <Setter Property="IsExpanded" Value="{Binding Source={StaticResource propertyGrid:PropertyGridViewModel}, Path=AreCategoriesAutoExpanded}"/> Finally in the viewmodel I just have an auto property:

Creating controls dynamically using xaml

霸气de小男生 提交于 2021-01-28 04:21:27
问题 I have a list of objects in my application using which I want to create Wrappanels dynamically. One way is to write control adding in code behind as below. WrapPanel RuleInternalCond = new WrapPanel(); // Create operator combo box and fill all operators ComboBox operatorCb = new ComboBox(); operatorCb.Items.Add("OR"); operatorCb.Items.Add("AND"); RuleInternalCond.Children.Add(operatorCb); But is there a better way to create a template of the wrap panel, bind it to my properties and use my

How can I combine XAML and a template into one C# template with Rg.Plugins.Popup?

扶醉桌前 提交于 2021-01-28 03:37:55
问题 I would like to simplify the addition of dialog popups in my code to the absolute minimum needed. Currently I have this code: <pages:PopupPage x:Class="Test.Popup" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"> <ContentView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"> <t:PopupFrame> <Label Text="ABC" /> <Label Text="ABC" /> </t:PopupFrame> <

Restyling the WPF Extended Toolkit's ChildWindow

喜你入骨 提交于 2021-01-28 02:50:28
问题 I have a modal dialog I am displaying using the WPF Extended Toolkit's ChildWindow but I don't like the default look of the window since it doesn't support System Colors correctly (it has a forced white background) and doesn't adapt to the Windows Classic Shell when being used. I am therefore trying to create my own style for the ChildWindow but in doing so I've broken the dialog behaviour of the control - how would I style it to get this behaviour back? My style for the dialog is as follows.

WPF - hide element when hovering a mouse over another element

坚强是说给别人听的谎言 提交于 2021-01-28 01:31:09
问题 There are some elements in a grid, and all I want is to show/hide the button when a mouse is over a rectangle. <UserControl ...> <Grid> <Rectangle ...> <Button ...> </Grid> </UserControl> I've tried several triggers but was unsuccessful so far. Please help. 回答1: This is what you need: A datatrigger bound to the Control to trigger it alternativly you could use a converter sth like a BoolenToInvisibilityConverter Ps if you want to invert the logic you need to set the visibility in the style as

Xamarin form: IValueConverter receive null value in Convert method

孤人 提交于 2021-01-27 21:29:35
问题 I have a list view set with item source as child. I want to bind a child object to a view which will set the color through the converter. The converter method got called but the value i passed in was null . Apart from dot, I also use Path=/ but the value passed to the converter still null . If i bind the property, it's fine but not the current item. <ListView x:Name="childListView" VerticalOptions="FillAndExpand" HasUnevenRows="true" ItemSelected="OnItemSelected" ItemTapped="OnItemTapped">