|
sunilkpv wrote: When the page is displayed the vertical or the horizontal scrollbars are getting displayed and hence the page appears cut. Please help me out to solve this issue
What do you WANT to happen?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
I want the silverlight web page to have scrolling capability. At present when i build and test the solution, the web browser doesn't display the contents completely as the contents are extending beyond the web browser window. I am not able to scroll it either horizontally nor vertically to see the full page contents because silverlight is not showing any (auto)scrollbars.
How could this problem be overcome?
NOTE: My silverlight canvas height is 1200 and width is 1500. Hence the web browser doesn't display the contents completely.
Thanks.
Sunil
|
|
|
|
|
<UserControl x:Class="SilverlightTester.LargeScrollyPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" >
<Canvas Width="1500" Height="1200" Background="LightSteelBlue" />
</ScrollViewer>
</UserControl>
Note: No Width/Height specified on UserControl.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks a lot Mark.
I will try this stuf and get back to you.
Thanks.
Sunil
|
|
|
|
|
Just great.
This is what I really needed.
Thanks.
Sunil
|
|
|
|
|
I am running some threads so that data initially gets loaded partially and then with the threads, the should get loaded at runtime.
But if I close the browser and the thread is not get completed at a certain point then it throws following error:
System.Exception was unhandled by user code
Message="Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))"
StackTrace:
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.CreateObjectByTypeIndex(UInt32 typeIndex)
at System.Windows.DependencyObject..ctor(UInt32 nativeTypeIndex, IntPtr constructDO)
at System.Windows.DependencyObject..ctor(UInt32 nativeTypeIndex)
at System.Windows.UIElement..ctor(UInt32 nKnownTypeIndex)
at System.Windows.FrameworkElement..ctor(UInt32 nKnownTypeIndex)
at System.Windows.Controls.Control..ctor(UInt32 nKnownTypeIndex)
at System.Windows.Controls.UserControl..ctor()
at ReeleezeeFormsEngine.Silverlight.CommonControls.Pager..ctor(String sectionCount)
at ReeleezeeFormsEngine.Silverlight.FormsRenderer.AutoLayoutGridManager..ctor(AutoLayoutGridManagerConfiguration configuration, String sectionCount)
at ReeleezeeFormsEngine.Silverlight.FormsRenderer.SequentialRenderer.backgroundWorkerForSection_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e)
at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
at System.ComponentModel.BackgroundWorker.<OnRun>b__1(Object state)
InnerException:
I am using BackgroundWorker for threading?
|
|
|
|
|
if your browser is close where you got error?
|
|
|
|
|
I have one button added each time when the thread gets completed for each time.
It means if it brings one chunk of data in one thread then one button added, then it brings another chunk then another button added, brings third chunk third button added, brings fourth chunk fourth button added and so on.....
But in between if we close the browser then exception occurs at the constructor of button control
|
|
|
|
|
I dont understand you problem clearly but,
It seem to me that you have problem when your application close.
Make sure you close all your thread at application close event.
Viral
|
|
|
|
|
How can i close all the threads before closing the window?
|
|
|
|
|
|
Good people,
I have a listbox embedded within a user control. The user control is then housed within a data template. I have created a dependency property for the user control; the type of this property is an observable collection that is intended to be the source of items for the listbox.
The difficulty I am having is that the listbox will not display the items when the user control is part of the datatemplate. It will display items when it is not part of the data template. I am pasting code below. Any help, advice or information would be really helpful. Thanks in advance.
Here is the code for the list box as it is in the user control.
<pre>
<ListBox SelectionChanged="ListBoxImages_SelectionChanged" IsSynchronizedWithCurrentItem="True" Margin="8,40.76,8,174.91" x:Name="ListBoxImages" Grid.Row="1" ItemsSource="{Binding Path=Photos, ElementName=UCAscensionImageManagement, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ItemTemplate="{DynamicResource DataTemplateImageList}">
</ListBox>
</pre>
This is the user control, that contains the listbox. It is in a datatemplate.
<pre>
<SG2_Ascension:UserControlAscensionImageManagement Margin="21.234,0,17.733,54" VerticalAlignment="Bottom" Height="475" x:Name="UCAIMEventPhotos" Width="615" Photos="{Binding Path=UCGeneralDataSeries, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
Finally, this is the dependency property as it is coded in the user control
<pre>
public static DependencyProperty PhotosProperty = DependencyProperty.Register(
"Photos", typeof(GeneralDataSeries), typeof(UserControlAscensionImageManagement)/*,
new FrameworkPropertyMetadata(new PropertyChangedCallback(OnRatingChanged))*/
);
/// <summary>
/// Photo objects.
/// </summary>
public GeneralDataSeries Photos
{
get
{
return (GeneralDataSeries)GetValue(PhotosProperty);
}
set
{
SetValue(PhotosProperty, value);
}
}
</pre>
Again, any help would be greatly appreciated.
|
|
|
|
|
On the ListBox you have
ItemsSource="{Binding Path=Photos, <code>ElementName=UCAscensionImageManagement</code>, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
In the usercontrol you have
x:<code>Name="UCAIMEventPhotos"</code> Photos="{Binding Path=UCGeneralDataSeries, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
I assume you mean to bind the ListBox ItemsSource to the UserControl Photos
property, correct?
If so, you used the wrong ElementName in the ListBox ItemsSource binding.
You could also try something like this:
ItemsSource="{Binding Path=Photos, RelativeSource={RelativeSource AncestorType={x:Type SG2_Ascension:UserControlAscensionImageManagement}}, Mode=OneWay}"
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
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++
|
|
|
|