|
It did also appear valid to me, but when the data templates were setup with a DataType={x:Type Interfaces:IShowTree}, the template was not applied and the name of the view model was shown. A little google for "DataTemplate Interface" returns lots of results all saying that DataTemplates don't work with interfaces. The main reason seems to be classes that imlement multiple interfaces would be difficult for WPF to pick the right DataTemplate to use.
|
|
|
|
|
The easy way to do this is to use a trick I describe here[^].
Basically, you don't show them as DataTemplate s. What you do is to convert your DataTemplate s into ControlTemplate s, and then have a single DataTemplate that uses DataTriggers to swap templates depending on the underlying data.
|
|
|
|
|
I'm working on a contacts list[^]
I have 2 questions:
1) I would like to only see the drop shadow when the contact is selected. Of course only one can be selected at any time.
2) How do i get the contact cards to flow across, right to left, then top to bottom? I'm guessing I need to implement a wrap panel, but I'm not sure how to fit it into my item template.
Here's my XAML:
<ListBox x:Name="Contacts"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ItemsSource="{Binding Contacts}"
SelectedItem="{Binding SelectedContact}">
<ListBox.ItemTemplate>
<DataTemplate>
<Border CornerRadius="3"
Height="200"
Width="300"
Padding="5"
Margin="8"
Background="White"
BorderBrush="DarkGray"
BorderThickness="1">
<Border.Effect>
<DropShadowEffect Color="DarkGray"
ShadowDepth="7"/>
</Border.Effect>
<Border Margin="2"
CornerRadius="3"
Padding="4"
BorderBrush="LightSteelBlue"
BorderThickness="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Image Height="45"
Width="45" Source="/Falcon.UI.WPF;component/Media/Images/customer_48.png"
Grid.Row="0"
Grid.Column="0"/>
<StackPanel Orientation="Horizontal"
Grid.Row="0"
Grid.Column="1">
<TextBlock Style="{Binding PageHeaderLabelStyle}"
FontSize="28"
Foreground="#2B579A"
Text="{Binding FirstName}"/>
<TextBlock Style="{Binding PageHeaderLabelStyle}"
FontSize="28"
Foreground="#2B579A"
Margin="5,0,0,0"
Text="{Binding LastName}"/>
</StackPanel>
<TextBlock Grid.Row="1"
Grid.Column="1"
Style="{Binding PageHeaderLabelStyle}"
FontSize="18"
Foreground="#2B579A"
Margin="0,-10,0,0"
Text="{Binding Title}"/>
</Grid>
</Border>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
for your second question try this link.
code taken from the link:
<Grid>
<ListBox ItemsSource="{Binding MovieList}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<Image Source="{Binding Image}" Stretch="None"/>
<Label Content="{Binding TitleWithYear}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</Grid>
|
|
|
|
|
Ok, that did it - sort of.
The cards are listed horizontally intially. When I make the app smaller, they dont't wrap around.
If it's not broken, fix it until it is
|
|
|
|
|
I have a couple of ComboBox controls in a form, as well as a ListView . When I click on a ComboBox , the drop-down portion shows up in the upper left corner of the desktop instead of under the ComboBox .
The ListView uses grouping, and has a custom style for the GroupItem. It follows:
<ControlTemplate TargetType="{x:Type GroupItem}" x:Key="SceneGroupItemTemplate" >
<Expander IsExpanded="True" >
<Expander.Header >
<Border Background="LightSteelBlue"
BorderBrush="SteelBlue"
BorderThickness="1"
HorizontalAlignment="Stretch">
<TextBlock FontSize="14"
FontWeight="Bold"
Margin="5,0,10,0"
Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor,
AncestorType={x:Type Expander}}, Path=ActualWidth}" >
<TextBlock Text="{Binding Path=Name}" />
<Grid Width="10"/>
(
<TextBlock Text="{Binding Path=ItemCount}" />
items)
</TextBlock>
</Border>
</Expander.Header>
<Expander.Content>
<ItemsPresenter />
</Expander.Content>
</Expander>
</ControlTemplate>
And it's used in the ListView like so:
<ListView x:Name="datagridScenes" SelectionMode="Single" >
<ListView.GroupStyle >
<GroupStyle HidesIfEmpty="False" >
<GroupStyle.ContainerStyle >
<Style TargetType="{x:Type GroupItem}" >
<Setter Property="Template" Value="{StaticResource SceneGroupItemTemplate}" />
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ListView.GroupStyle>
</ListView>
Can anyone tell me why this is happening (see comment in code block above)?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
modified 15-Aug-12 11:11am.
|
|
|
|
|
Have you retemplated your ComboBox at all, or have you applied a Style to it?
|
|
|
|
|
Nope - it's naked.
<ComboBox Width="180" >
<ComboBoxItem Content="Dynamic Scene (deprecated)" />
<ComboBoxItem Content="Conditional Dynamic Scene" IsSelected="True" />
</ComboBox>
My initial thought is some sort of naming collision regarding styles, but that seems unlikely.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
The controls are in a UserControl that's in a Window , which itself is called up by the app's main window.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
It's got something to do with the Width attribute in the outer-most TextBlock element in the ControlTemplate Resource definition...
<TextBlock FontSize="14" FontWeight="Bold" Margin="5,0,10,0"
Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Expander}}, Path=ActualWidth}" >
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
John, I'm a bit confused as to your template. Specifically, this part:
<Border removed="LightSteelBlue"
BorderBrush="SteelBlue"
BorderThickness="1"
HorizontalAlignment="Stretch">
<TextBlock FontSize="14"
FontWeight="Bold"
Margin="5,0,10,0"
Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor,
AncestorType={x:Type Expander}}, Path=ActualWidth}" >
<TextBlock Text="{Binding Path=Name}" />
<Grid Width="10"/>
(
<TextBlock Text="{Binding Path=ItemCount}" />
items)
</TextBlock>
What are you trying to achieve with that initial TextBlock? It has no content.
|
|
|
|
|
Even if I simplify the actual content of the group item, the Width attribute prevents the combo boxes from working.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
I can't recreate the problem. However, you have a border in there with one sizing constraint, and then you have a child element inside the border, setting it's own size based on the parent of the border. Is there a reason you can't just bind the border size to the expander size?
|
|
|
|
|
Already tried that - didn't have any effect.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Put Blu-ray movies on New iPad and keep the file size around 2GB
Summary:
Some users have individual needs to save storage space or get the video quality they want, when they rip Blu-ray movies for iPad 3. Pavtube Blu-ray Ripper is just the one that can meet people's needs. Here the article will talk about how to convert Blu-ray movies for New iPad with file size around 2GB and frame rate 24fps.
When users put Blu-ray movies on iPad 3, some of them have individual needs to save storage space or get the video quality they want. Below is a question asked by a friend.
"I will have a journey soon and want to get some of by blu-ray disks on ipad for the flight. Here's my question:
how do I rip a blu-ray to my iPad and keep the file size around 2GB? I’d like to set frame rate at 24fps or original. Is there any blu-ray ripper app let me do so? Thanks
ps. i have an ipad 3".
As you see, to solve his problem, we need an almighty Blu-ray Ripper. Which can rip and transfer Blu-ray movies to new iPad with file size around 2GB and frame rate 24fps.Pavtube Blu-ray Ripper is just the one you are looking for.
For this question, we need to solve three problems, first, rip and convert the Blu-ray. Second, keep file size around 2GB. Third, set frame rate at 24fps. Now, i will use Pavtube Blu-ray to iPad 3 converter to show you how to make it.
First of all, you should download and install this new iPad 3 Blu-ray Ripper on your computer. After launched it, import your Blu-ray movies into it. As far as i know, it supports importing Blu-ray/DVD disc, Blu-ray/DVD folder, Blu-ray/DVD ISO image and more.
The most important step is selecting output for iPad 3. This tool is designed rather user-friendly. There are many iPad presets in "iPad" category. As follows:
How to keep the file size around 2GB?
Actually, the output file size mainly depends on the output format you choose for iPad 3. Generally, higher quality with bigger size, as you see, if you choose Full HD preset as output, certainly, the video size must be over 2GB. Is there any solution for us not only keep file size around 2GB, but also keep the movie with high quality? With the " Split " function of this Blu-ray Ripper, you can easily make it. Here is how to do it.
To start splitting, check the file that you want to split, then choose the option “Split selected task”.
When the Video Split window pops up, tick off Enable > Split file size (MB), and either enter the desired maximum size of each file chunk or choose an appropriate size from the available drop down option. In the case I entered 2000 MB for each chunk of file. 2GB is equal to 2048 MB, so if you want your file size less than 2GB, just enter/choose the maximum size under 2048 MB.
How to set frame rate at 24fps or original?
By clicking "Settings", you are allowed to custom the video quality. As follows:
Finally, just start converting Blu-ray to iPad 3. Hope the best software to convert bluray for ipad3 with file size around 2GB and frame rate 24fps
can solve your problem.
Now, you can get this Blu-ray Ripper for new iPad with 20% discount during Pavtube 2012 Summer Sale.
http://www.pavtube.com/2012-summer-sale.html[^]
|
|
|
|
|
Hi,
I want to create missed call project.
If any call on given number call will disconnect one ring.
how can i got on which number caller make call. I want to connect more then one modem or PRI Line.
Regards
Vikash Yadav
Thanks & Regards
Form :-
Vikash Yadav
Mob : 9210907172
|
|
|
|
|
What on earth does this have to do with WPF or Silverlight?
|
|
|
|
|
Wrong forum.
And posting your number is not a great idea.
|
|
|
|
|
Hello,
I need to call third party API from SL 5 solution. Solution has two projects - Client code in SL 5 and Web server project.
Question: How to and from where to call third party API - Client code or web server project?
The API can send response in JSON or XML.
Thanks,
Bhavesh
|
|
|
|
|
Tbhavesh wrote: How to and from where
Reading the documentation is a good place to start. Most likely you would call their web service from your client code.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Add the reference of API to your solution and call it from the client code.
|
|
|
|
|
I have a requirement to crop an image in oval shape and save the cropped image.Can anyone provide some useful links or a working solution.Appreciate an early response.Enviornment is VS 2010 & Silverlight 4 or above.
|
|
|
|
|
While this[^] project just uses a cropped rectangle, it should be easy enough to translate it to include a cropped oval.
|
|
|
|
|
I have an Address entity:
public class AddressEntity : _EntityBase
{
public AddressTypeEntity AddressType { get; set; }
public string Street1 { get; set; }
public string Street2 { get; set; }
public string City { get; set; }
public string State { get; set; }
public string ZipCode { get; set; }
public bool IsPrimary { get; set; }
public string DisplayValue { get; set; }
}
On the Address Edit dialod I have a combo box of AddressTypes. It's bound to an ObservableCollection of AddressTypeEntity. I can see the address types when I drop down the list.
Here's the AddressTypeEntity
public class AddressTypeEntity : _EntityBase
{
public string Caption { get; set; }
}
Pretty simple so far.
The problem is that the Caption is not showing in the drop down. Here's the XAML for the combobox:
<ComboBox x:Name="Types"
Grid.Row="2"
Grid.Column="1"
ItemsSource="{Binding AddressTypes}"
SelectedItem="{Binding SelectedAddressType, Mode=TwoWay}"
Margin="5,0,0,0"
VerticalAlignment="Center"
HorizontalAlignment="Left"
FontFamily="Segoe UI"
FontSize="14"
Foreground="DarkSlateGray"
Width="140">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Address.AddressType.Caption}"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
I'm pretty sure that the problem is in the template, I just can't see what I'm doing wrong.
Anyone?
If it's not broken, fix it until it is
|
|
|
|
|
Your collection is of AddressTypeEntity? If it is, you don't need to bind to Address (this entity has no idean what these properties are). Just bind to AddressType.Caption.
|
|
|
|
|