|
John Simmons / outlaw programmer wrote: Am I correct in assuming that if this works, then my global style is correct and that there is a problem either in the designer or in WPF?
It would seem logical. Is it something you could send over to me for me to check out? It would be easier for me to diagnose that way.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I'm not sure that you would get the same results without getting the entire project, and I'm almost positive the boss wouldn't like it if I shipped off the entire project to someone not in our employ. :/
"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 staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
It's time for you to snoop then, I'm afraid.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi there, is anyone familair with or knows if it's possible to create dynamic plugins for a silberlight web project.
For example.
Say you create a silverlight page template showing a banner, menu etc.. and in the middle you have a grid. Now, I've been able to iterate the assembly and create instances of control pages and plop them into the grid, however, I was wondering if it was possible to create control DLL's (based on itnerface) and have them load on demand, as fast as they are dropped into the application BIN folder.
Perhaps even scan a server side bin folder and periodically scan the DLLs.. Any solutions?
thanks
modified 7-Dec-20 21:01pm.
|
|
|
|
|
|
Yes. You can use Composite WPF version 2. OR you can also try Microsoft Extension Framework for Silverlight.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
I'm having a problem positioning elements and not sure where I'm going wrong. The elements are basically ellipsegeometry paths, since all of the elements are have the same radius.x and radius.y I've added a property Radius that I set when I add them.
This code should position them without an overlap and it works fine as long as the elements have the same radius
Public Sub Group2Elements(ByVal Conductor1 As Conductor, ByVal Conductor2 As Conductor, ByVal Angle As Double)
Dim DeltaX As Double = System.Math.Cos(Radians(Angle)) * (Conductor1.Radius + Conductor2.Radius)
Dim DeltaY As Double = System.Math.Sin(Radians(Angle)) * (Conductor1.Radius + Conductor2.Radius)
Dim Cond2Center As Point = New Point(Conductor2.GetValue(Canvas.LeftProperty) + Conductor2.Radius, Conductor2.GetValue(Canvas.TopProperty) + Conductor2.Radius)
Conductor1.SetValue(Canvas.LeftProperty, (Cond2Center.X + DeltaX) - Conductor1.Radius)
Conductor1.SetValue(Canvas.TopProperty, (Cond2Center.Y + DeltaY) - Conductor1.Radius)
End Sub
and the function to convert Degrees to Radians is as follows
Private Function Radians(ByVal Deg As Double) As Double
Radians = Deg * System.Math.PI / 180
End Function
The other problem I'm having is positioning 1 element next to 2 other elements, once again if the elements have the same radius it seems to work.
Public Sub Group3Elements(ByVal Conductor1 As Conductor, ByVal Conductor2 As Conductor, ByVal Conductor3 As Conductor, ByVal Side As Integer)
Dim DeltaX As Double
Dim DeltaY As Double
Dim Angle As Double
Dim aLength, bLength, cLength As Double
Dim aAngle, bAngle, cAngle As Double
aLength = Conductor3.Radius + Conductor1.Radius
bLength = Conductor2.Radius + Conductor1.Radius
cLength = Conductor2.Radius + Conductor3.Radius
aAngle = Degrees(System.Math.Acos((bLength ^ 2 + cLength ^ 2 - aLength ^ 2) / (2 * bLength * cLength)))
bAngle = Degrees(System.Math.Acos((aLength ^ 2 + cLength ^ 2 - bLength ^ 2) / (2 * aLength * cLength)))
cAngle = Degrees(System.Math.Acos((aLength ^ 2 + bLength ^ 2 - cLength ^ 2) / (2 * aLength * bLength)))
If Side = 0 Then
Angle = AngleBetween(Conductor2, Conductor3) - aAngle
Else
Angle = AngleBetween(Conductor2, Conductor3) + aAngle
End If
DeltaX = System.Math.Cos(Radians(Angle)) * (Conductor2.Radius + Conductor1.Radius)
DeltaY = System.Math.Sin(Radians(Angle)) * (Conductor2.Radius + Conductor1.Radius)
Dim Cond2Center As Point = New Point(Conductor2.GetValue(Canvas.LeftProperty) + Conductor2.Radius, Conductor2.GetValue(Canvas.TopProperty) + Conductor2.Radius)
Conductor1.SetValue(Canvas.LeftProperty, (Cond2Center.X + DeltaX) - Conductor1.Radius)
Conductor1.SetValue(Canvas.TopProperty, (Cond2Center.Y + DeltaY) - Conductor1.Radius)
End Sub
and the AngleBeteween code is as follows
Public Function AngleBetween(ByVal Conductor1 As Conductor, ByVal Conductor2 As Conductor) As Double
Dim Angle As Double
Dim Cond1Center As Point = New Point(Conductor1.GetValue(Canvas.LeftProperty) + Conductor1.Radius, Conductor1.GetValue(Canvas.TopProperty) + Conductor1.Radius)
Dim Cond2Center As Point = New Point(Conductor2.GetValue(Canvas.LeftProperty) + Conductor2.Radius, Conductor2.GetValue(Canvas.TopProperty) + Conductor2.Radius)
Angle = Degrees(System.Math.Asin((Cond2Center.Y - Cond1Center.Y) / (Conductor2.Radius + Conductor1.Radius)))
If Cond2Center.X < Cond1Center.X Then Angle = 180 - Angle
AngleBetween = Angle
End Function
and finally the the function to convert Degrees to Radians is
Private Function Degrees(ByVal rad As Double) As Double
Degrees = rad * 180 / System.Math.PI
End Function
Again both Group2Elements & Group3Elements work if the elements all have the same radius if they don't there's no telling where they will end up.
Any help would be appreciated
Thanks
|
|
|
|
|
jward wrote: if the elements have the same radius it seems to work
So, the problem is that if the elements don't have the same radius then it won't work?
Can you send the example project to me so I can take a look and will see whether I can help you to solve the problem or not? My email is mchlsync AT gmail DOT com.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
Hi,
I am new to Windows 7 application development & want to integrate my Application for Windows 7 Taskbar capability.
Before that, I downloaded the sample code from: http://code.msdn.microsoft.com/Windows7Taskbar/Release/ProjectReleases.aspx?ReleaseId=2246[^]
But whenever I run it & try to add a JumpList it throws me COM Exception.
The details of the exception is as below:
<br />
System.Runtime.InteropServices.COMException was unhandled<br />
Message="Exception from HRESULT: 0x80040F03"<br />
Source="Windows7.DesktopIntegration"<br />
ErrorCode=-2147217661<br />
StackTrace:<br />
at Windows7.DesktopIntegration.Interop.ICustomDestinationList.AppendCategory(String pszCategory, IObjectArray poa)<br />
at Windows7.DesktopIntegration.JumpListDestinations.RefreshDestinations(ICustomDestinationList destinationList) in D:\installer\Windows7IntegrationLibrary_Taskbar_Libraries\Windows7IntegrationLibrary_Taskbar_Libraries\DesktopIntegration\Windows7.DesktopIntegration\JumpLists\JumpListImpl.cs:line 62<br />
at Windows7.DesktopIntegration.JumpListManager.Refresh() in D:\installer\Windows7IntegrationLibrary_Taskbar_Libraries\Windows7IntegrationLibrary_Taskbar_Libraries\DesktopIntegration\Windows7.DesktopIntegration\JumpLists\JumpListManager.cs:line 418<br />
at Windows7.DesktopIntegration.MainDemo.Windows7Form.btnBuildJumpList_Click(Object sender, EventArgs e) in D:\installer\Windows7IntegrationLibrary_Taskbar_Libraries\Windows7IntegrationLibrary_Taskbar_Libraries\Demo\Taskbar\Windows7.DesktopIntegration.MainDemo\Windows7Form.cs:line 256<br />
at System.Windows.Forms.Control.OnClick(EventArgs e)<br />
at System.Windows.Forms.Button.OnClick(EventArgs e)<br />
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)<br />
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)<br />
at System.Windows.Forms.Control.WndProc(Message& m)<br />
at System.Windows.Forms.ButtonBase.WndProc(Message& m)<br />
at System.Windows.Forms.Button.WndProc(Message& m)<br />
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)<br />
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)<br />
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br />
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)<br />
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)<br />
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)<br />
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)<br />
at System.Windows.Forms.Application.Run(Form mainForm)<br />
at Windows7.DesktopIntegration.MainDemo.Program.Main() in D:\installer\Windows7IntegrationLibrary_Taskbar_Libraries\Windows7IntegrationLibrary_Taskbar_Libraries\Demo\Taskbar\Windows7.DesktopIntegration.MainDemo\Program.cs:line 26<br />
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)<br />
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)<br />
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()<br />
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br />
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br />
at System.Threading.ThreadHelper.ThreadStart()<br />
InnerException: <br />
<br />
Can anybody in this forum please help me to findout what's the problem is & how can I resolve it.
Any help regarding the same is highly appreciable.
Thanks in advance...
Regards,
- Kunal Chowdhury ( My Blog)
modified on Tuesday, July 21, 2009 6:32 AM
|
|
|
|
|
Did you by any chance visit the Windows 7 Team Blog? They have a recent blog entry regarding coding for jump lists.
"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 staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
yes.... I also followed the steps from there. In all the cases... it is throwing me the same error.
Regards,
- Kunal Chowdhury ( My Blog)
|
|
|
|
|
|
Thanks Keeron. I got the answer.
Regards,
- Kunal Chowdhury ( My Blog)
|
|
|
|
|
We're in the process of creating a 3D modelling application similar to AutoCAD, but with a twist. It is being written specifically for a furniture manufacturer which will use the application to create 3D representations of his furniture. He will also be able to edit the different parts included in a table for example, widening the parts, adding new parts, etc. So far the user can select a piece of furniture from a database, and then 3D models will be created for each part belonging to the specific piece of furniture. Each part has dimensions which is read from the database, but now, these parts need to be added to the viewport in a specific way so that when the entire model is generated, it actually looks like a table (or whatever furniture was selected). At the moment all the parts overlap beacuse they just get added in a fixed position, and we have to use Mousetracking to move the parts around manually.
Anyone have an idea of how the models can be positioned more efficiently without having to move the models around manually with the mouse?
You can have a look at this amazing Sawdust[^] application to get an idea of what we're trying to accomplish.
|
|
|
|
|
The "easiest" way to do this would be to create a composite model, which is a model of all of the parts added together - you would then add this. This is not a trivial task, because you want to maintain a hierarchy of objects, plus the transformations that need to be applied to them to create the final state.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi,
I have to add a "Search Box" with a DropDown Button for searching the books.
This dropdown button should have an arrow pointing downwards and the search textbox next to it. so, wen i click on dropdown button, i should get few options (like team, personal, e........) If i select Team then the text "Search in Team" should be displayed in the textbox. A small magnifier for the searchbox will be available too.
I am using C#, XAML..its WPF app
Please help me.
Thanks
Ramm
|
|
|
|
|
So, what have you done so far?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi,
Currently, I have added the button and textbox to the window and added this code to it.
<pre> <Button x:Name="btnSearch" Content="TWB" Width="60" HorizontalAlignment="Left" Height="30" Click="btnSearch_Click"></Button>
<Popup x:Name="btnSearchPopUp" Margin="60,-30,0,0" Width="45" HorizontalAlignment="Left"
PlacementTarget="{Binding ElementName=btnSearch}"
PopupAnimation="Fade">
<ListBox x:Name="TransitionKind" Width="75">
<ListBoxItem Content="TWB"/>
<ListBoxItem Content="PWB"/>
<ListBoxItem Content="Other"/>
<ListBoxItem Content="None"/>
</ListBox>
</Popup></pre>
in the c# code
<pre> private void Window_Loaded(object sender, RoutedEventArgs e)
{
btnSearch.Click += new RoutedEventHandler(btnSearch_Click);
TransitionKind.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(TransitionKind_SelectionChanged);
}
void TransitionKind_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
btnSearch.Content = ((ListBoxItem)TransitionKind.SelectedItem).Content;
btnSearchPopUp.IsOpen = false;
txtBxSearch.Text = "Search " + (string)btnSearch.Content;
}
private void btnSearch_Click(object sender, RoutedEventArgs e)
{
btnSearchPopUp.IsOpen = true;
}
</pre>
actually this provides me the dropdown of the button, but a small traingle kind of thing on the button indicating the dropdown and magnifying glass is not included.
Please help me, the more better way to do this.
Thanks
Ramm
|
|
|
|
|
I have tried the application that is listed
Silverlight Auto Complete Treeview[^]
It seems to be a good solutions accessing the View Model in a MVVM application using the treeview. The core of this article is based on Bea Stollnitz's solution to treeview expansion in Silverlight. However, it does not like to get binded using DataContext and ItemsSource in XAML. Does anybody has come up with a solution?
|
|
|
|
|
Hello,
Are you setting Model to the datacontext of MainPage? If yes, you will need to load the xml file from the constructor of that Model class and will add to add one more property in Model class.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
it was just a long day...thanks though.
|
|
|
|
|
I'm getting a XamlParseException on startup of my WPF application when compiled for debug. If I rebuild the solution, the problem goes away until the next time I start VS2008 with this solution.
Tracing the inner exceptions shows that the exception is being thrown because it can't locate a resource dictionary being loaded through a relative pack URI, like this:
ResourceDictionary table = new ResourceDictionary();
table.Source = new Uri(@"/Delta;component/Framework.xaml",UriKind.Relative); I've Google'd this, but not found anything that specifically points at this problem. I believe it's a bug involved in using the "Visual Studio hosting process", but I'm not sure.
Has anyone else seen this?
Software Zen: delete this;
|
|
|
|
|
"Delta" is the assembly name and Framework.xaml is in that assembly, right?
The build action for Framework.xaml (in the Delta project) should be "Page".
If the above are correct, then I'd say there's malformed XAML somewhere in
Framework.xaml.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for the reply, Mark. The build action for Framework.xaml is indeed Page. Here's the source for Framework.xaml:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:System;assembly=mscorlib">
<s:String x:Key="DeltaCommon.PrintView_Unwind">Unwind</s:String>
<s:String x:Key="DeltaCommon.PrintView_Cabinet">Cabinet/{0}</s:String>
<s:String x:Key="DeltaCommon.PrintView_Rewind">Rewind</s:String>
<s:String x:Key="DeltaCommon.SetupView_Rewind">Rewind</s:String>
</ResourceDictionary> I have a hard time believing this is a problem with the XAML, given that a 'rebuild solution' corrects the problem until the next time Visual Studio is started with this solution.
I no longer believe the Visual Studio hosting process is involved, since disabling it has no effect. The exception is still thrown the first time the application runs after Visual Studio loads the solution. The exception stops being thrown after the solution is rebuilt.
Software Zen: delete this;
|
|
|
|
|
What are you doing with the dictionary "table" after you set its Source?
Also, do you have all 2008 service packs and hotfixes installed?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|