|
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.
|
|
|
|
|
I'm trying to sync the combobox's selected item to the address type on the address entity.
AddressType is not a property on the ViewModel. It's on the AddressEntity.
If it's not broken, fix it until it is
|
|
|
|
|
If you are going to post code classes, then throw us a bone and at least post the right code classes. How on earth could we guess this based on your original posting?
|
|
|
|
|
I figured it out.
1) Set the bindng to just Caption.
2) In the VM I did:
private void loadAddress()
{
Street1 = Address.Street1;
Street2 = Address.Street2;
City = Address.City;
State = Address.State;
ZipCode = Address.ZipCode;
var addressType = (from at in AddressTypes
where at.Id == Address.AddressType.Id
select at).FirstOrDefault();
SelectedAddressType = addressType;
}
I was hoping to do it just with bindings, but this works.
If it's not broken, fix it until it is
|
|
|
|
|
I have a TreeView Control populated by a Public Property in a ViewModel:
<TreeView HorizontalAlignment="Stretch" Margin="5" Name="TreeView1"
VerticalAlignment="Stretch" Grid.Row="2"
ItemsSource="{Binding Path=AssetTree.FirstGen}">
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsExpanded" Value="{Binding IsExpanded., Mode=TwoWay}"/>
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
<Setter Property="FontWeight" Value="Normal"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="FontWeight" Value="Bold"/>
</Trigger>
</Style.Triggers>
</Style>
</TreeView.ItemContainerStyle>
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
<StackPanel Orientation="Horizontal">
<Image Source="/MMS.Modules.Maintenance;component/Images/Tooling.png" Height="20"/>
<TextBlock Text="{Binding Code}"/>
</StackPanel>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
How do I bind the Image control to a property of the child collection? e.g. the Category property?
Do I use a converter for this?
I don't speak Idiot - please talk slowly and clearly
"I have sexdaily. I mean dyslexia. Fcuk!"
Driven to the arms of Heineken by the wife
|
|
|
|
|
Same way you are with Code. You don't need a converter, just return the ImageSource from the VM.
|
|
|
|