|
*sigh*... oh well... gotta open up a ticket with MS then I suppose . My experience with MS if its a bug that only affects you is "you're SOL. Do it some other way." .
|
|
|
|
|
Hmm... well, this is weird... dunno what inspired me to try this, but I added an AdornerDecorator to my ListViewItem template as the top level item in the template and now I can't seem to reproduce this issue anymore.
|
|
|
|
|
[UPDATE]
Added "ScrollViewer.HorizontalScrollBarVisibility="Disabled" and it works now.
[UPDATE]
I am working on a Contacts List[^]
when I resize the window, they don't wrap. See this.[^]
here's my XAML:
<ListBox x:Name="Contacts"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ItemsSource="{Binding Contacts}"
SelectedItem="{Binding SelectedContact}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True"
Orientation="Horizontal"
FlowDirection="LeftToRight"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<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>
Hhow do I make the wrap?
Thanks
If it's not broken, fix it until it is
modified 20-Aug-12 20:57pm.
|
|
|
|
|
I have a set of data that can be defined by the user, this will consist of item types i provide to them, for example (Text/Date/Decimal/Address/Lookup/Group). A group allows them to put related data together, groups can be nested as deep as the user requires. Think Composite pattern. As every user is able to create their own structure how it is best displayed will also vary from user to user.
I would like to be able to provide a mechanism that allows the user to select how they want their data displayed. To do this i have created a ResourceDictionary for each way of displaying the data but i've struggled to find a good way to implement switching between display methods. I have looked into switching the ResourceDictionary in code but could not find a good way to implement this. I've also thought about implementing a DataTemplateSelector and again struggled to get this working.
I tried creating empty interfaces (IShowAsTree, IShowAsTabs, IShowAsGroupBoxes), implementing them all in my view that holds the data, and casting when i return the property they are bound to.
public interface IBaseView{}
public interface IShowAsTree:IBaseView{}
public interface IShowAsTabs:IBaseView{}
public interface IShowAsGroupBoxes:IBaseView{}
public class DataCollection:BaseVM, IShowAsTree, IShowAsTabs, IShowAsGroupBoxes
{
}
public class ExtenededDataView:BaseVM
{
public String[] ViewAsOptions{get{return new[] {"Tree","Tabs","GroupBoxes"}}
private String _viewAs;
public String ViewAs
{
get {return _viewAs;}
set
{
_viewAs = value;
OnPropertyChanged(()=>View);
}
}
private DataCollection _view;
public IBaseView View
{
get
{
switch(ViewAs)
{
case "Tree":
return _view as IShowTabs;
break;
}
}
}
}
This failed, should have known but DataTemplating appears to only work on classes not interfaces. This is when i decided on quite a hack for a solution, replace the interfaces with classes, and put a property in the parent class that holds the DataCollection. This works but feels wrong, so if any one can advice me of a better solution, or an area to research more it would be appreciated. Thanks to anyone who read this far, code was typed in so may well contain the odd error, but hopefully its enough to describe the problem.
Working Hack:
public class SwitchMyUI
{
public DataCollection Details { get; set; }
public SwitchMyUI(DataCollection details)
{
Details = details;
}
public SwitchMyUI(SwitchMyUI copyFrom)
{
Details = copyFrom.Details;
}
}
public class ShowTabs : SwitchMyUI
{
public ShowTabs(SwitchMyUI copyFrom) : base(copyFrom)
{
}
}
public class ShowTree : SwitchMyUI
{
public ShowTree(SwitchMyUI copyFrom) : base(copyFrom)
{
}
}
Edit: Included WPF in the title
|
|
|
|
|
Im a little confused as to what exactly you are trying to do. Do you want to creat a custom "user control" of sorts?
|
|
|
|
|
I'm trying to allow the user to switch which DataTemplate is used for an object based on a choice by the user. At a very basic level consider an oject you have written called MyObject:
<ResourceDictionary>
<DataTemplate DataType={x:Type MyObject}>
<Rectanble Width="50" Height="50"/>
</DataTemplate>
<DataTemplate DataType={x:Type MyObject}>
<EllipseWidth="50" Height="50"/>
</DataTemplate>
<DataTemplate DataType={x:Type MyObject}>
<TextBox Width="120" Height="30" Text={Binding MyObjectName}/>
</DataTemplate>
</ResourceDictionary>
That resource Dictionary provides 3 different DataTemplates for the same object, what i want is a mechanism to let the user pick which one gets used, but in the actual situation things are a little more complex, but once i sort the right way to do the switching then i'll be able to implement that for the more complex situation.
|
|
|
|
|
I don't find the interface approach incorrect. Using interfaces to implement more complex templating sounds like a valid pattern to me.
|
|
|
|
|
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.
|
|
|
|
|