|
Thanks Mark,
It seems you are on to the solution. The only error it's giving me is that it says "the type reference cannot find a public type named 'UserControlAscensionImageManagement'.
This is unexpected since the listbox, and thus this declaration, is occurring within the UserControlAscensionImageManagement XAML file. Wow!
At any rate, let me know if you have any additional thoughts. I am continuing to work on finding a solution on my end.
Thanks for any additional information you can provide.
|
|
|
|
|
BlitzPackage wrote: The only error it's giving me is that it says "the type reference cannot find a public type named 'UserControlAscensionImageManagement'.
Even after a rebuild?
Is the class marked public?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hmmmm...haven't tried a rebuild. Also, yes the class is marked public. I will try a rebuild shortly.
Rebuilds usually erase all of my test data in the database and force me to start from scratch. However, I will try it and let you know.
Thanks again.
|
|
|
|
|
BlitzPackage wrote: Rebuilds usually erase all of my test data in the database and force me to start from scratch.
hmm ok. That doesn't sound like a friendly environment for WPF development...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I need to shut down the entire application when the user clicks this button, but I don't know how to check if the window was closed via the "X" button or some other button.
Apologies for cross posting this topic.
|
|
|
|
|
Didn't this get an answer the other day ? Handle the form closing event and the event args will tell you what caused the form to close.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I've been trying for an hour and can't get them to show up. I want three TextBlock fields in the StatusBar, each separated by a Separator. The TextBlock fields show up fine. I want the middle field to to be centered and take up all the space that the left and right fields do not, and my XAML does achieve this. Here is that XAML. I tried an explicit width of 10 for the two Separator elements, but that didn't make a difference. What am I doing wrong?
<StatusBar
Grid.Row="1"
DockPanel.Dock="Bottom"
Height="23"
VerticalAlignment="Bottom"
BorderBrush="Black"
BorderThickness="0,.5,0,0"
>
<StatusBar.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</StatusBar.ItemsPanel>
<StatusBarItem
Grid.Column="0"
>
<TextBlock
Name="statusBarHelp"
>
</TextBlock>
</StatusBarItem>
<StatusBarItem
Grid.Column="1"
>
<Separator></Separator>
</StatusBarItem>
<StatusBarItem
Grid.Column="2"
HorizontalContentAlignment="Center"
>
<TextBlock
Name="statusBarFullPath"
>
</TextBlock>
</StatusBarItem>
<StatusBarItem
Grid.Column="3"
>
<Separator></Separator>
</StatusBarItem>
<StatusBarItem
Grid.Column="4"
>
<TextBlock
Name="imageCount"
Padding="0,0,10,0"
>
</TextBlock>
</StatusBarItem>
</StatusBar>
|
|
|
|
|
If you want seperators, why not add them as a border on the controls, you can specify different widths for the border, so put 10,0 on the middle one to get 10 on each side. Otherwise, I expect you'd need to specify widths on the seperator itself, and specify a width of 10 on your column definition.
WPF is a PITA, it's way too hard to get stuff to appear at the size you asked for.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Christian Graus wrote: If you want seperators, why not add them as a border on the controls
Borders on the controls are a last resort possibility, but my question was, why don't the Separator elements show up? I shouldn't have to specify a width on them, as their constructor should specify a default width. In no other code I've ever seen do you have to specify a width for a Separator.
But I experimented by setting a width and was shocked to discover that the Separator in a StatusBar is a horizontal line, not a vertical line as one should expect. One should expect that, right? I suppose a horizontal line will work, but I wonder who's brilliant idea it was at Microsoft to make a Separator a horizontal line in a WPF StatusBar? Isn't that totally nonstandard? You'd expect horizontal lines only between items arranged vertically, like the separators between menu items.
Christian Graus wrote: I expect you'd need to specify widths on the seperator itself, and specify a width of 10 on your column definition.
I tried an explicit width on the column definition and it didn't work, so went back to Width="Auto" . When I specified a width on the separator itself, that's when I discovered the very strange thing that the Microsoft developer has done, in making separators horizontal lines in status bars instead of vertical lines. This almost seems like a bug to me. I should just put a vertical bar in there.
|
|
|
|
|
fjparisIII wrote: I wonder who's brilliant idea it was at Microsoft to make a Separator a horizontal line in a WPF StatusBar?
It isn't. It's orientation is based on the ItemsControl it is used as an item in.
You didn't use them as ItemsControl items so you got the default horizontal
orientation.
See my other replies for two ways you can use the separators in a more correct fashion.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I took the Separator elements out. Those horizontal lines just look like a kludge.
|
|
|
|
|
fjparisIII wrote: I took the Separator elements out.
Why would you take the separator elements out if you want separators?
I gave you two working examples - one that you can totally customize
the style of the separators, and another that uses the default style.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Why would you take the separator elements out if you want separators?
I gave you two working examples - one that you can totally customize
the style of the separators, and another that uses the default style.
I took them out before I saw your examples. After I saw your second example, I put them back in. Now they look great. Thanks for your attention.
|
|
|
|
|
*Edit*
With your Separators wrapped in StatusBarItem, they default to a horizontal orientation, so
you'd need to give your separators a vertically oriented style, otherwise you can't see them...
<StatusBar Grid.Row="1"
DockPanel.Dock="Bottom"
Height="23"
VerticalAlignment="Bottom"
BorderBrush="Black"
BorderThickness="0,.5,0,0" >
<StatusBar.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</StatusBar.ItemsPanel>
<StatusBarItem Grid.Column="0" >
<TextBlock Text="TextBlock 1" Name="statusBarHelp" />
</StatusBarItem>
<StatusBarItem Grid.Column="1" >
<Separator >
<Separator.Style>
<Style TargetType="{x:Type Separator}">
<Setter Property="Height" Value="20"/>
<Setter Property="Margin" Value="2,0,2,0"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<Border BorderBrush="LightSlateGray" BorderThickness="1"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Separator.Style>
</Separator>
</StatusBarItem>
<StatusBarItem Grid.Column="2" HorizontalContentAlignment="Center" >
<TextBlock Text="TextBlock 2" Name="statusBarFullPath" />
</StatusBarItem>
<StatusBarItem Grid.Column="3" >
<Separator >
<Separator.Style>
<Style TargetType="{x:Type Separator}">
<Setter Property="Height" Value="20"/>
<Setter Property="Margin" Value="2,0,2,0"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<Border BorderBrush="LightSlateGray" BorderThickness="1"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Separator.Style>
</Separator>
</StatusBarItem>
<StatusBarItem Grid.Column="4" >
<TextBlock Text="TextBlock 3" Name="imageCount" />
</StatusBarItem>
</StatusBar>
In my second reply is a simpler version with the StatusBarItem wrappers removed.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
modified on Sunday, June 21, 2009 5:06 PM
|
|
|
|
|
Shouldn't that style then be a template, so it gets reused ? :P
OK, so a seperator is invisible without a style ? I've never used one, so I had no idea about that.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
|
Christian Graus wrote: Shouldn't that style then be a template, so it gets reused ?
That exercise is left to the reader
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
To use the default Separator style, remove the StatusBarItem
wrappers from the Separators:
<StatusBar Grid.Row="1"
DockPanel.Dock="Bottom"
Height="23"
VerticalAlignment="Bottom"
BorderBrush="Black"
BorderThickness="0,.5,0,0" >
<StatusBar.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</StatusBar.ItemsPanel>
<StatusBarItem Grid.Column="0" >
<TextBlock Text="TextBlock 1" Name="statusBarHelp" />
</StatusBarItem>
<Separator Grid.Column="1" />
<StatusBarItem Grid.Column="2" HorizontalContentAlignment="Center" >
<TextBlock Text="TextBlock 2" Name="statusBarFullPath" />
</StatusBarItem>
<Separator Grid.Column="3" />
<StatusBarItem Grid.Column="4" >
<TextBlock Text="TextBlock 3" Name="imageCount" />
</StatusBarItem>
</StatusBar>
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Okay, now we're talking. Good answer. Thanks, Mark. Looks good. I just make them invisible when the middle TextBlock is empty. Sure was a lot of screwing around for a lousy pair of Separator elements.
|
|
|
|
|
Hi,
I am working on a WPF application. In this I need to find the temporary drives created i.e., like drives created when some mobile or pen drive are created. From this Temporary drive created I need to get the image files.
If any one have any idea to get the names or path of the temparory drives created please reply me.
Thanks in advance.
|
|
|
|
|
|
|
Please don't create a new account. You're the only person on EARTH who thinks it's wise to mix a 'browser application' ( i.e. you will put a web browser control in a window ), with a database.
CBenac wrote: Data Source=TOSHIBA_PC\SQLEXPRESS
Is this your local machine ? Have you tried logging in with a username and password ? Have you googled the error message to see possible solutions ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
|
A WPF browser application runs in the browser ? I would assume that the issue is the application being sandboxed then.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|