|
The ResourceDictionary Source="" line is what I'm having trouble with as I'm breaking it down to:
Source="/YourCompanyName.SolutionName.Styles;component/MainDictionary.xaml"
Sure this is something daft I'm missing...
|
|
|
|
|
The bit before ;component is the name of the dll so the solution name has no bearing on this ...
So in a solution called MySolution there is a project called Styles containing a MainDictionary.xaml file in the project root (not in a subdirectory in the project your line would be:
Source="/Styles;component/MainDictionary.xaml"
If I did this the line would look something like:
Source="/JamSoft.SampleSort.Styles;component/MainDictionary.xaml"
If MainDictionary.xaml was actually in a subdirectory of the Styles project called SubDirectory1 the line would be:
Source="/JamSoft.SampleSort.Styles;component/SubDirectory1/MainDictionary.xaml"
I've uploaded the demo solution I made for you yesterday. You can get it here:
http://www.jammer.biz/downloads/WPFStylesApp1.zip[^]
I think your assuming the solution has more prominence than it does. I think of it as merely a way to link projects together in a single loadable group. The projects themselves could have absolutely no relation to each other, if that is the case it would be odd to have them in the same solution but thats another topic entirely!
|
|
|
|
|
Got it working! The demo was brilliant, thank you so much. When I have the App.xaml in the other projects it all works brilliantly, but now I have the problem of the projects which are Class Librarys not accepting App.xaml Application Definitions. I've tried the Themes/generic.xaml with a link to the MainDictionary but its not working.
Thanks very much for your help - would have been struggling for days!
Becky
|
|
|
|
|
If you think about it what your seeing makes perfect sense ...
How can a class library have an application definition file? Its NOT an application, its a class library ...
|
|
|
|
|
Yep, I spent most of yesterday trying to work out a way to avoid linking to the MainDictionary in all the xaml's I need the styling for, but there doesn't seem to be a way with it being a Class Library.
Working though
|
|
|
|
|
So what's in these dll's? Do the dll's provide views in the app?
|
|
|
|
|
Hi,
I have 3D cube which I want to move anywhere on screen on mouse move or mouse click. As whenever I tried to move it using mouse it rotates around some point (origin).
Is there any method to move this point (origin) anywhere else on screen.
e.g. in this example of a 3D book (www.codeproject.com/KB/WPF/3D-BookWriter.aspx) if you reduce the size of book (by holding right click on black portion and dragging it to left) and try to move it around then you will see it rotates around some point.
I just want to move it to say Bottom Right corner of screen.
Thanks for any help in advance.
Regards,
Parag
|
|
|
|
|
In my datagrid the date is displayed with time , how to format it and display in dd/MM/yyyy format . Help me please
|
|
|
|
|
If you are binding to collection of custom objects such as Person and that class has a property such as BirthDate you could do the following:
First, create DateTimeConverter class as such:
Imports System.Windows.Data
Public Class DateTimeConverter
Implements IValueConverter
Public Function Convert(ByVal value As Object, _
ByVal targetType As System.Type, _
ByVal parameter As Object, _
ByVal culture As System.Globalization.CultureInfo) As Object _
Implements System.Windows.Data.IValueConverter.Convert
Dim DateValue As DateTime = value
Return DateValue.ToShortDateString()
End Function
Public Function ConvertBack(ByVal value As Object, _
ByVal targetType As System.Type, _
ByVal parameter As Object, _
ByVal culture As System.Globalization.CultureInfo) As Object _
Implements System.Windows.Data.IValueConverter.ConvertBack
Dim StrValue As String = value.ToString()
Dim ResultDateTime As DateTime
If DateTime.TryParse(StrValue, ResultDateTime) Then
Return ResultDateTime
End If
Return value
End Function
End Class
Next, add xmlns to to your projects namespace so you can get reference to your new class such as:
xmlns:local="clr-namespace:Silverlight_DataGrid"
Next, depending on what type of control you are using to bind to, add reference to your converter for date column. In this case, I have single column in grid, which is bound to DataGridTextColumn. The property in my class i'm binding to is BirthDate.
<data:DataGrid x:Name="myDataGrid" Grid.Row="1"
AlternatingRowBackground="AliceBlue"
Background="WhiteSmoke"
BorderBrush="DarkBlue" BorderThickness="2"
CanUserResizeColumns="True"
CanUserSortColumns="True"
Opacity="8"
AutoGenerateColumns="False">
<data:DataGrid.Columns>
<data:DataGridTextColumn Binding="{Binding BirthDate, Converter={StaticResource DateConverter}}" />
</data:DataGrid.Columns>
</data:DataGrid>
|
|
|
|
|
Thank You very much for ur reply
and it works fine . Thank u again
|
|
|
|
|
HI Guys.
I came know we can do the single application which can run in both windows(Desktop) and in web(Browser) using wpf but i dont know how its possible, if any guys have idea about this topic please share with me.
Thanks In Advance
vinith
|
|
|
|
|
I suspect that you are thinking of XBAPs. You may want to take a look here[^].
|
|
|
|
|
I have a WPF form with a gridsplitter. The cursor is set to SizeWE, but it does not show the resize cursor on a mouseover. I can use it for resizing, so the control can grab the mouse.
Has anyone seen this problem? Any ideas?
Johan Lombaard
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein
|
|
|
|
|
Can you post your XAML please.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi,
I have exactly the same problem.
here is my complete code:
<Grid Background="SteelBlue" x:Name="mainGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250"/>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="250" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="25" />
</Grid.RowDefinitions>
<Border BorderThickness="4" BorderBrush="SteelBlue" Background="White">
<WFDesigner:WorkflowListView x:Name="WorkflowList" Margin="10"/>
</Border>
<WFDesigner:WorkflowDetailView x:Name="WorkflowDetail" Margin="0,4" Grid.Column="1" Background="White"/>
<GridSplitter HorizontalAlignment="Right" Grid.Column="1" ResizeBehavior="CurrentAndNext" Width="4" Background="Red" />
<Border BorderThickness="0,4,4,4" BorderBrush="SteelBlue" Grid.Column="2" Background="White">
<Grid x:Name="ToolboxProperties" DockPanel.Dock="Right">
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<ContentControl Content="{Binding ToolboxControl}"/>
<ContentControl DataContext="{Binding SelectedItem}" Content="{Binding Designer.PropertyInspectorView}" Grid.Row="1"/>
</Grid>
</Border>
<StatusBar Grid.Row="1" Grid.ColumnSpan="3" >
<TextBlock Text="{Binding Status}" Margin="5,0" />
</StatusBar>
</Grid>
I tried overriding it by setting "Cursor" value in the GridSplitter XAML definition but it didn't work.
Any idea?
|
|
|
|
|
Hi, This is what I do
<GridSplitter Grid.Column="0" ResizeDirection="Columns" Background="LightGray" Width="5" MouseEnter="GridSplitter_MouseEnter" MouseLeave="GridSplitter_MouseLeave"/>
private void GridSplitter_MouseEnter(object sender, MouseEventArgs e)
{
if (this.Cursor != Cursors.Wait)
Mouse.OverrideCursor = Cursors.SizeWE;
}
private void GridSplitter_MouseLeave(object sender, MouseEventArgs e)
{
if (this.Cursor != Cursors.Wait)
Mouse.OverrideCursor = Cursors.Arrow;
}
I first check if the mouse is already in Waiting mode, as I dont want the users to be able to resize the app while I am doing some other stuff.
Hope it helps
|
|
|
|
|
hi,
try to set the cursor directly to the gridspliter.
you can do this in you constructor
mygridSpliter.Cursor = Cursors.SizeWE;
|
|
|
|
|
Setting the splitter cursor does not seem to work either. My code from the mouseEnter event.
private void GridSplitter_MouseEnter(object sender, MouseEventArgs e)
{
GridSplitter gridSplitter = sender as GridSplitter;
if (gridSplitter.Name == "Splitter1")
{
Splitter1.Cursor = Cursors.SizeWE;
}
}
|
|
|
|
|
Good Morning All
After my ouputed(DeepZoom)project, i open my Project in VS2008 and buit the Project and i got this Error. Google did not help.
Unknown build error, 'Binary Format of the Specified Custom attribute was invalid
What is Wrong ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
Have you used VS2008 SP1 ?
Which version of SL do you use ?
|
|
|
|
|
Yes am using VS2008 SP1 and Silverlight 2
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
I think so you're using Expression Blend , isn't it ?
|
|
|
|
|
No Am using Visual Studio 2008 and i have created this Project from the latest DeepZoom.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
Some days ago, I was working Expression Blend 2 and VS2008 SP1 and I got the same error .
I've reinstalled .Net Framework (3.5 SP1), and my problem has solved.
|
|
|
|
|
Thanks for your reply. I have a Problem Sometimes understanding Versions. I have tried to get rid of Beta Silverlight staff installed on my machine. Can you please tell me the Difference between 3.5 SP1 and 3.5, Can you please send me a link where i can download the Setup for offline Installation.
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|