datatemplate

Windows Phone 8.1 App dont see DataType property in DataTemplate

六眼飞鱼酱① 提交于 2019-12-01 14:16:26
I created new Windows Phone 8.1 project and when I try to set DataType , vs2013 give me in editor error: The property 'DataType' was not found in type 'DataTemplate' . In WPF application I dont have this problem. How to fix it? This is my MainPage.xml: <Page x:Class="App6.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:App6" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Background="

Xamarin datatemplate with bindings in code behind not working

醉酒当歌 提交于 2019-12-01 13:32:28
问题 I have tried to make a page in my app where all controls are generated dynamically via C# code behind. I am using a Nuget Packages, DLToolkit, flowlist to create a flow list. I have already used this package in my project before using Xaml , and it fully works. However when I try to create a datatemplate in code behind, it just displays a blank control, however when hovering above this control, you can see there's actually items in it. My question is: How can I make a datatemplate with

How to accessing Elements in XAML DataTemplate Listview without interacting with it

青春壹個敷衍的年華 提交于 2019-12-01 12:10:21
I have a C# Store App and using DataTemplate Selectors to determine which type of Template to use in a ListView Control bound to an Array. Because it is templated, I cannot assign a dynamic x:Name to each ListView Row. I need to be able to access the listview rows by Index and set the Visibility of them to On or Off. I have tried things like this, but the .ItemContainerGenerator .ContainerFromItem(item); return null and I get a Nullable exception every time: How do I access a control inside a XAML DataTemplate? After doing some research, it appears that the above solution only works if I touch

Why DataBinding is not propagating to UserControl

无人久伴 提交于 2019-12-01 12:08:54
问题 This morning I asked a question here and doing a simple working sample gave me a different behavior than expected. Full working sample at GitHub. Main partial code below. In this present case, the command is never propagated to any UserControl, either if the UserControl is use directly as a child of the Window. It also not work if the UserControl is used as a DataTemplate for a ListBox ItemTemplate. I also include a hack button to fix the problem where the Command reach the UserControls. The

How can I get a close button on a templated TabItem in WPF?

痴心易碎 提交于 2019-12-01 11:13:57
I have a TabControl where the TabItem s are DataTemplat ed. The template seems to work correctly, in that the usercontrol I want to show in the TabItem is showing correctly. What I am not sure of is how to get a "x" to show up in the TabItem so I can close each tab, since they are dynamically generated through a template. Being fairly new to WPF, I am starting to pick up on many of the concepts, but the TabControl gave me a lot of trouble, so I may very well have the template workable, but not maintainable. This is what I have, and I would like to be able to close each TabControl . I will also

How to accessing Elements in XAML DataTemplate Listview without interacting with it

南楼画角 提交于 2019-12-01 10:29:46
问题 I have a C# Store App and using DataTemplate Selectors to determine which type of Template to use in a ListView Control bound to an Array. Because it is templated, I cannot assign a dynamic x:Name to each ListView Row. I need to be able to access the listview rows by Index and set the Visibility of them to On or Off. I have tried things like this, but the .ItemContainerGenerator .ContainerFromItem(item); return null and I get a Nullable exception every time: How do I access a control inside a

WPF - data binding trigger before content changed

折月煮酒 提交于 2019-12-01 09:35:56
How do i create trigger, which fires BEFORE binding changes value? How to do this for datatemplate? <ContentControl Content="{Binding Path=ActiveView}" Margin="0,95,0,0"> <ContentControl.Triggers> <--some triger to fire, when ActiveView is changing or has changed ?!?!? --> </ContentControl.Triggers> public Object ActiveView { get { return m_ActiveView; } set { if (PropertyChanging != null) PropertyChanging(this, new PropertyChangingEventArgs("ActiveView")); m_ActiveView = value; if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("ActiveView")); } } How to do this

How can I get a close button on a templated TabItem in WPF?

混江龙づ霸主 提交于 2019-12-01 08:22:40
问题 I have a TabControl where the TabItem s are DataTemplat ed. The template seems to work correctly, in that the usercontrol I want to show in the TabItem is showing correctly. What I am not sure of is how to get a "x" to show up in the TabItem so I can close each tab, since they are dynamically generated through a template. Being fairly new to WPF, I am starting to pick up on many of the concepts, but the TabControl gave me a lot of trouble, so I may very well have the template workable, but

WPF - data binding trigger before content changed

谁说我不能喝 提交于 2019-12-01 08:06:11
问题 How do i create trigger, which fires BEFORE binding changes value? How to do this for datatemplate? <ContentControl Content="{Binding Path=ActiveView}" Margin="0,95,0,0"> <ContentControl.Triggers> <--some triger to fire, when ActiveView is changing or has changed ?!?!? --> </ContentControl.Triggers> public Object ActiveView { get { return m_ActiveView; } set { if (PropertyChanging != null) PropertyChanging(this, new PropertyChangingEventArgs("ActiveView")); m_ActiveView = value; if

WPF - ItemTemplate not acting as expected

为君一笑 提交于 2019-12-01 06:41:35
I have a UserControl which I'm using to display a list of UIElement s. The control consists of a single ItemsControl with it's ItemPanelTemplate switched for a horizontal StackPanel , its ItemsSource bound to a DependencyProperty exposed by the UserControl and its ItemTemplate set in the UserControl.Resources . Everything works fine except the ItemTemplate never get's applied and I can't see why. The full source is below. UserControl.xaml - <UserControl x:Name="UC" x:FieldModifier="private" x:Class="ContentSliderControl.ContentSlider" xmlns="http://schemas.microsoft.com/winfx/2006/xaml