|
I thought you might like that answer better than the other guy's
(no offence to the other guy)
|
|
|
|
|
Hi,
I have created a Silverlight page and Default.html to host it. Here is the relevant HTML code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<!-- saved from url=(0014)about:internet --><head>
<title>Intribute Dynamics</title>
<style type="text/css">
html, body {
height: 100%;
overflow: auto;
}
body {
padding: 0;
margin: 0;
}
#silverlightControlHost {
height: 100%;
}
</style>
..........
<!-- Runtime errors from Silverlight will be displayed here.
This will contain debugging information and should be removed or hidden when debugging is completed -->
<div id='errorLocation' style="font-size: small;color: Gray;"></div>
<div id="silverlightControlHost">
<object data="data:application/x-silverlight," type="application/x-silverlight-2" width="1024px" height="1024px">
<param name="source" value="ClientBin/EntributeSilverlight.xap"/>
<param name="onerror" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40624.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration: none;">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
</a>
</object><iframe id='_sl_historyFrame' style='visibility:hidden;height:0;width:0;border:0px'></iframe></div>
</body>
</html>
How can I place the Silverlight page at the center of the browser at all times, regardless of the size of my Silverlight page? I have tried some suggestions from my search on the web. Unfortunately none of them have worked.Best,
Jun
|
|
|
|
|
How about this[^] I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Have tried that, w/o success. Best,
Jun
|
|
|
|
|
Try setting the Verticalalignment and Horizontalalignment of your silverlight content to Center in the xaml.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Hi All.I am new to 3D graphics in wpf.
I have created few geometrymodel3d inside model3dgroup in wpf with rotation and zooming.It works fine.But i want to add text to each model such a way it should not rotate with the model.
Now i have added text,but it also rotates with the the model during rotations.
My requirement is text should move according to rotation of model but should not rotate.
(i.e) text should be at the front of 3d model at what position it may be rotated.
I think if i get the position of each model according to rotation and zoomin i can position the text,but am not sure whether there is a way to get the position of the model.
Could anybody tell,Any better idea to solve my problem?
Thanks in Advance.
|
|
|
|
|
Hi i want to make one WPF control library applcaiton.
In that i will load images depends on the text.
So i used code like this
if (string.Compare(AlStatus,"HH")==0)
src1 = @"pack://application:,,,/WpfApp;component/data/HH.bmp";
else
src1 = @"pack://application:,,,/WpfApp;component/data/Normal.bmp";
.
.
Img1.Source = new ImageSourceConverter().ConvertFromString(src1) as ImageSource;
It works fine when i build this as windows applcaiton.
But when i convert it to control library and loaded in VC++ aplcaition,it shows error at bolded line as
Could not load file or assembly 'WpfApp, Culture=neutral' or one of its dependencies. The system cannot find the file specified.Anu
|
|
|
|
|
I have a nested grid that I would like to have grow as needed when the grid splitter is moved. I am probably using the wrong layout. When the Window is expanded, the GridSplitter moves normally. When the Window is reduced horizontally, the horizontal scroll bar correctly appears and allows for viewing both lists, but the GridSplitter does not move at all.
I suspect this is because the nested Grid is only designed to fill the space, while maintaining a minimum size. The behavior I would like to see, is to have the cell immediately to the left of the GridSplitter expand or contract as it moves, leaving the sizes of the Grid cells to the right of the splitter untouched.
I attempted to use the DragDelta and DragCompleted events of the GridSplitter to affect the left cell, but that caused strange results.
Please let me know how I can ask this question more clearly. I have been a coder for nearly 2 decades, but never really focused on front end.
<Window x:Class="TestWpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Test WPF App" Height="300" Width="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition MinWidth="50"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Background="Black"></Grid>
<Grid Grid.Column="1">
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Disabled">
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="100"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition MinWidth="100"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<ListView Margin="0,0" Name="listView1" SelectionMode="Single" />
</ScrollViewer>
</Grid>
<GridSplitter Background="Red" Grid.Column="1" Grid.Row="0"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
<Grid Grid.Column="2">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<ListView Margin="0,0" Name="listView2" SelectionMode="Single" />
</ScrollViewer>
</Grid>
</Grid>
</ScrollViewer>
</Grid>
</Grid>
</Window> Jeremy A. Cunningham
|
|
|
|
|
I'm not sure I fully understood your question, but this seems to do what you want (though it is admittedly complicated):
XAML:
<Window x:Class="QuickWPFTest.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="500" Name="MyWin" Loaded="MyWin_Loaded">
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition MinWidth="50"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Background="Black"></Grid>
<Grid Grid.Column="1" HorizontalAlignment="Stretch" Name="OuterGrid" SizeChanged="OuterGrid_SizeChanged">
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Disabled">
<Grid HorizontalAlignment="Stretch" Name="InnerGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition MaxWidth="{Binding MaxColumnWidth, ElementName=MyWin}"
Name="FirstColumn" MinWidth="100" Width="*"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition MaxWidth="100" MinWidth="100"></ColumnDefinition>
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<ListView Margin="0,0" Name="listView1" SelectionMode="Single" />
</ScrollViewer>
</Grid>
<GridSplitter Background="Red" Grid.Column="1" Grid.Row="0"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
<Grid Grid.Column="2">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<ListView Margin="0,0" Name="listView2" SelectionMode="Single" />
</ScrollViewer>
</Grid>
</Grid>
</ScrollViewer>
</Grid>
</Grid>
</Window>
C#:
using System.ComponentModel;
using System.Windows;
namespace QuickWPFTest
{
public partial class Window1 : Window, INotifyPropertyChanged
{
public Window1()
{
InitializeComponent();
}
private void MyWin_Loaded(object sender, RoutedEventArgs e)
{
ChangeWidth();
}
private void OuterGrid_SizeChanged(object sender, SizeChangedEventArgs e)
{
OnPropertyChanged("MaxColumnWidth");
if (InnerGrid.ActualWidth > OuterGrid.ActualWidth)
{
ChangeWidth();
}
}
private void ChangeWidth()
{
double diff = InnerGrid.ActualWidth - OuterGrid.ActualWidth;
double newWidth = FirstColumn.ActualWidth - diff;
if (newWidth < 0) newWidth = 0;
FirstColumn.Width = new GridLength(newWidth);
}
public double MaxColumnWidth
{
get
{
return OuterGrid.ActualWidth - 100 - 3;
}
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string name)
{
if (this.PropertyChanged != null)
{
this.PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
}
}
|
|
|
|
|
I decided to use a StackPanel inside of the outer grid cell instead of nesting grids. I then created an image to sit directly to the right, and is used as a grabbing point to adjust the width. It works very well.
Thank you!Jeremy A. Cunningham
Quoth the Raven, "Shazbot!"
|
|
|
|
|
Glad to hear you got something working. FYI, this seems to work reasonably well too:
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition MinWidth="50"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Background="Black"></Grid>
<Grid Grid.Column="1">
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Disabled">
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="100"></ColumnDefinition>
<ColumnDefinition Width="103"></ColumnDefinition>
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<ListView Margin="0,0" Name="listView1" SelectionMode="Single" />
</ScrollViewer>
</Grid>
<Grid Grid.Column="1">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<ListView HorizontalAlignment="Stretch" Margin="3 0 0 0"
Name="listView2" SelectionMode="Single" />
</ScrollViewer>
</Grid>
<GridSplitter ResizeBehavior="PreviousAndNext"
ResizeDirection="Columns" Background="Red" Grid.Column="1" Grid.Row="0"
Height="Auto" Width="3" HorizontalAlignment="Left"
VerticalAlignment="Stretch" />
</Grid>
</ScrollViewer>
</Grid>
</Grid>
|
|
|
|
|
Hi there,
I am new to WPF. I have some 2 textboxes and a button on the form. Below these, there is a grid.
My requirement is to resize the grid and realign the controls, according to the size of the window.
Thanks and Regards
-
Sameer
|
|
|
|
|
I think you should learn something about the grid before using it. Check this http://www.wpftutorial.net/GridLayout.html
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:44am.
|
|
|
|
|
Hi,
I have created a silverlight app with Expression Blend. When I load the XAML into Visual Studio, I can see the designer view of each page. However, the property pane for controls is filled with this error message "Property editing not available". Without the property window, how do I select a specific event that I want to handle?
Thanks,Best,
Jun
|
|
|
|
|
The Expression Blend may add some properties for its designer tool. These properties are not applicable in visual stdio so vs shows error message.
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:46am.
|
|
|
|
|
Vusual Studio 2008 doesn't allow this. The 2010 version will
|
|
|
|
|
Hi,
I know how to handle either hover or click event on a button control, by setting "ClickMode". What is the XAML code to handle both events? Do I set "ClickMode" twice?
Thanks,Best,
Jun
|
|
|
|
|
It looks that you should set "ClickMode" twice.
April
Comm100 - Leading Live Chat Software Provider
|
|
|
|
|
You cannot set ClickMode twice - you can probable change it through your code (if that is what you meant).Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Hi Guys,
I found FindResoouce method in Expression blend and working fine.. But when I use the same in VS2008, not working.
What is the issue?Ahamed Azeem
software Programmer
|
|
|
|
|
I searched for FindResource in my 80,000 line WPF application and came up with 323 hits, all of which work. So it definitely works in VS2008. We obviously need more information from you. What does your code look like and where are you storing the resource in your solution?
|
|
|
|
|
Dear Gents,
I am new to WPF.
I have created small animation using rectangle using Microsoft Expression Blend. But when i run the project that animation is not running and the image is as it is on the screen.
Please let me know where i went wrong?
Regards
AzeemAhamed Azeem
software Programmer
|
|
|
|
|
do u think only gents can answer this? Gomathi R
|
|
|
|
|
Gents is the short form of Gentlemens.. ok Ahamed Azeem
software Programmer
|
|
|
|
|
See According to your definition also only Gents answered. Ahamed Azeem
software Programmer
|
|
|
|