by Markus
17. December 2010 01:04
Solution is described here
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/2f755d30-bd8c-4f9b-b36a-9cb56bea15cd/
The initializeComponent routine is created in the .g.cs file that is created during build. (see obj\debug\...)
Make sure your XAML file has a build action of "Page" to create that file.
Also, make sure that the partial classes in .xaml.cs and .g.cs match.
Hope that helps.
Thanks, Rob Relyea
WPF Team
< Back
81b3f157-8531-4638-b63a-1c6bff6a40d9|0|.0
Tags:
by Markus
25. November 2010 23:04
Ein super Beitrag aus Word.
c1363aed-b407-43e2-8178-423997a0adde|0|.0
Tags:
by Markus
12. May 2010 18:42
ilMerge, a Microsoft Tool for merging Assemblies, is not working for merging WPF Assemblies. But Richard Dingwall had a very good idea (see here)
There was one Problem with the code for me (see Comments). When referencing Styles or Resources in the App.xaml the OnStartup Event is called to late. The Resources are needed before OnStartup. So Richard suggested to register the handler in the Constructor of the App Class, and this is working like a charm!
Here is some sample Code to Download. Use it as you want without any warranty…
The important part of the Code looks like this now:
public partial class App : Application {
public App() {
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(ResolveAssembly);
}
static Assembly ResolveAssembly(object sender, ResolveEventArgs args) {
//We dont' care about System Assembies and so on...
if (!args.Name.ToLower().StartsWith("clever")) return null;
Assembly thisAssembly = Assembly.GetExecutingAssembly();
//Get the Name of the AssemblyFile
var name = args.Name.Substring(0, args.Name.IndexOf(',')) + ".dll";
//Load form Embedded Resources - This Function is not called if the Assembly is in the Application Folder
var resources = thisAssembly.GetManifestResourceNames().Where(s => s.EndsWith(name));
if (resources.Count() > 0) {
var resourceName = resources.First();
using (Stream stream = thisAssembly.GetManifestResourceStream(resourceName)) {
if (stream == null) return null;
var block = new byte[stream.Length];
stream.Read(block, 0, block.Length);
return Assembly.Load(block);
}
}
return null;
}
}
< Back to Content
c14961fb-66a6-49ec-bdaf-58161710a1b8|0|.0
Tags:
by Markus
25. March 2010 20:09
Web Traffic Debugging with Fiddler
Step 1
Download Fiddler from http://www.fiddlertool.com
Step 2
Configure Fiddler to work with Visual Studio Development Server.
- Set your Web Project to use a Fixed Port like 10000 (Under VS - Project – Properties – Web)
- Start Fiddler and aktivate to Capture the Traffic (Under Fiddler – File – Capture Traffic)
- Insert the following script in function OnBeforeRequest in the Fiddler Custom Rules (Under Fiddler – Rules – Customize Rules)
if (oSession.host=="name:10000"){
oSession.host="127.0.0.1:10000";
}
- Start the debugging session in your VS. Change the Browsers address line from
- localhost:10000 to
- name:10000
- From now on Fiddler is showing you all traffic
- Click in Fiddler on View – Inspector and use the Tabs of the inspector to see the complete traffic.
Here you see also detailed Error Messages if a Service you called from Silverlight is failing…
< Back to Content
085b710c-0f2f-4eb5-b4c5-10b999bb811b|0|.0
Tags:
by Markus
25. March 2010 19:50
Silverlight Deployment: InitializeError
(in german)
Fehler: Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Die Silverlight-Anwendung konnte nicht heruntergeladen werden.
Überprüfen Sie die Webservereinstellungen.
Step1:
Check if the Path in the Page referencing the Silverlight Applications is correct. Use Fiddler to debug the traffic and error messages if you are not sure if the path is correct.
Step2:
Check if the MINME Types for your Silverlight applications are registered in the IIS. You can check this in IIS6 under Properties of the Server and under IIS7 under Mime Types.
< Back to Content
f3ba6fb7-ecd0-4f15-bb4c-43934b169c30|0|.0
Tags:
by Markus
26. January 2010 18:26
TextBlock TextWrapping in ListBoxItem
If you have a ListBox and and you want to stretch the ListBox Items to fit exactly the width of the Textbox you have to Edit the Template for the Listbox and set the HorizontalContentAlignment for the ListBox Items to Stretch.
Now, if you have a TextBlock in a Listbox Item and the Text is longer than the Width of the Listbox but you don’t want the Listbox Item to extend its width but to wrap the Text you will have to set the HorizontalScrollbar to disabled.
< Back to Content
539f4c12-2626-4a1f-a748-2916df285047|0|.0
Tags:
by Markus
26. January 2010 18:21
Error Message during Compile: File or Files has invalid value "<<<<<<< .mine". Illegal characters in path
That is something that SVN inserts into a file when it tries to merge its version of a file.
Simplest thing to resolve this which i tried doing was ...
remove any characters "<<<<<<< .mine" or similar from the file that you will see in your project object folder namely
<Projectname>.csproj.FileListAbsolute.txt
which contains a list of all the paths and recompile ...it worked for me
You may should read more at
http://tortoisesvn.tigris.org/faq.html
< Back to Content
3e307e77-2545-43bc-af60-cac18f5b2f93|1|5.0
Tags:
by Markus
30. December 2009 22:27
5d10842c-2ed1-4ece-ab0e-2d8f21688f60|0|.0
Tags:
by Markus
18. December 2009 01:59
Namespace Appname.Web.Resources not Found in New Silverlight RIA Project
Problem: You have a Working Silverlight RIA Application. Now You want to add a second new Silverlight Application. After doing this you will get the Complier Error:
error CS0234: The type or namespace name 'Resources' does not exist in the namespace 'Appname.Web'
The Problem is, that you have to add some Resource Files manually!
In the First Silverlight Project you have the folder Web/Resources and their are some files.
Solution:
Create the Folder Web/Resources in the New Silverlight project and Link the same Files as in the first Silverlight project.
< Back to Content
93f67354-11a6-4725-8c03-8f1da7b20f8c|0|.0
Tags:
by Markus
14. December 2009 20:31
Transitions
Out their are some real good transitions frameworks, but almost all of them are really hard to understand for a normal developer. So I wrote some easy functions doing the work, understandable for every Silverlight developper…
The sample code can be downloaded here:
(Coming soon…)
bb7d2437-027e-4d3f-be2b-65eac446e405|0|.0
Tags: