|
Nope
Face it, any time you are bypassing the native rendering engine the OS uses you are going to take a performance hit. I don't care what anyone says.
This is why Vista and 7 are 'NEW'. They were written with the intent to support this new look and feel so the OS internals, all the way down to the rendering engines, were optimised towards that purpose intentionally.
On older OSes if you turn off native rendering and do all your own window drawing in your code you are always going to incur a performance hit because you are essentially moving that code up a layer, or at very least adding cycles in the way to signal an alternate rendering routine.
|
|
|
|
|
I have a page defined in xaml, and I'm using a 3rd-party control. I've created a style that overrides the control's template, and I've added a couple of new "parts" to the template.
In the C# code, when I call control.FindName("MyNewPart") , it returns null . I tried calling control.ApplyTemplate() before calling FindName , but it returns false.
How do I get that part from the control?
I GAVE UP ==============================
Yeah, I spent a couple days on this problem and with nothing to show for it that could be even remotely viewed as "progress".
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
modified on Thursday, May 20, 2010 11:19 AM
|
|
|
|
|
4 Finding a Control in the ControlTemplate
private void OnFindChildInTemplate(object sender, RoutedEventArgs e)
{
Button btn = sender as Button;
ControlTemplate template = btn.Template;
Border child = template.FindName("TheBorder", btn) as Border;
var btn1 = child.TemplatedParent;
}
From Link[^]
|
|
|
|
|
Nope - won't work because a ControlTemplate object does not expose a FindName method in Silverlight.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
Is there any tool available in the market to migrate an ASP.NET based application to Silverlight application?
Appreciate a quick reply.
|
|
|
|
|
Don't cross-post: you should only post your question in one forum.
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
No.
You're going to have to rewrite the entire thing.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
AFAIK, nothing exists.
My signature "sucks" today
|
|
|
|
|
Hi Shubhabrata,
There's exist no such tool to convert ASP.NET application to a Silverlight application. ASP.NET applications & Silverlight applications are two different things and there is no relation between them. One is in .aspx and the other is in .xaml. The controls are all different for them. Thus, you can't use any tool to convert from one to another.
If you want to migrate from one to the other, you have to know each technology first and then you have to manually convert them. Once migrated to Silverlight, you will get more power over your application with the help of Rich UI and StoryBoards.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
Hi experts,
Created one WPF custrol control library, added reference of WPF toolkit.
used only datagrid as a base class in customcontrol1.cs file and trying to use it in WPF application, although all property of datagrid is exposed but data is not getting binded at runtime.. Pls anyone help me to rectify the issue
Thanks in advance..
|
|
|
|
|
kartheesh wrote: property of datagrid is exposed but data is not getting binded at runtim
What are you doing to bind your collection to your datagrid at runtime?
My signature "sucks" today
|
|
|
|
|
Hi Abhinav,
I used itemsource as well as datacontext, same is working fine when i used datagrid directly(i.e without custom control datagrid). Also I face same issue with custom control combobox, I feel something need to be added on generic.xaml
- kartheesh
|
|
|
|
|
Could you please post the CustomControl1.cs code?
|
|
|
|
|
Hi Castle,
Please find the below code, just i have inherited datagrid as shown below.
Namespace of datagrid is (Microsoft.Windows.Controls)
Source Code:
------------
[DefaultProperty("Columns")]
[ContentProperty("Columns")]
public partial class CustomControl1 : DataGrid
{
static CustomControl1()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomControl1), new FrameworkPropertyMetadata(typeof(CustomControl1)));
}
}
|
|
|
|
|
Hi experts,
Any findings on the above issue.
|
|
|
|
|
I need to display several characters from the Wingdings 3 font family. That's the name of the font family, not the name of the True Type font family file. What I did was copy the wingdng3.ttf file to my project root and made sure that its BuildAction was set to Resource. Then in my XAML I use this syntax to display a single character at the beginning of a TextBlock:
<TextBlock
Name="section1Title"
>
<Run FontFamily="WingDng3.ttf#Wingdings 3"></Run> Help on the tutorials
</TextBlock>
When displayed in my application, the wingding character appears as a square, just as in the above markup, but you'd expect that in the markup. But appearing as a square in the running Silverlight application indicates that the font family I chose for it was not located. What am I doing wrong?
Edit: Upon further investigation I discovered that my "expectation" about the display of the markup was wrong. If the font can be displayed, it is displayed properly in the markup, at least in VS2010. Nevertheless, I still don't know how to get VS2010 to display an embedded font.
modified on Tuesday, May 18, 2010 6:12 PM
|
|
|
|
|
I was able to get a basic grid going: http://img14.imageshack.us/img14/7344/sample2vm.png
I have a problem with that extra cell in the grid. I have been unsuccessful to remove it. Perhaps someone can see what the issue is?
code is here:
http://pastebin.com/EWL88e6p
|
|
|
|
|
If your datagrid width is fixed, then you will continue to get that cell.
It could also be because your Grid row width is hard coded.
Trying setting the width to auto.
*Edit*
Er...yes I mean grid column width and not the row height - apologies.
*Edit*
modified on Monday, May 17, 2010 11:32 PM
|
|
|
|
|
Which width do you mean?
I added the auto here and it takes care of the problem! thanks!
<Grid x:Name="LayoutRoot">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
modified on Monday, May 17, 2010 11:01 PM
|
|
|
|
|
Made modifications to my original answer.
Glad to know that this worked.
|
|
|
|
|
THank you very much, one thing I need there is to make the pie bigger, I keep adding to the width but it does not grow.
|
|
|
|
|
What width are you setting? Are you setting the width of the pie chart or the grid?
My signature "sucks" today
|
|
|
|
|
I've been trying to figure out how Silverlight communicates with a WCF Web service when the VS2010 Silverlight solution is set up as an ASP.NET Web Application Project rather than an ASP.NET Web Site. As you know, when you set up a Web Application Project, the Web service is generated as a .dll assembly rather than a set of loose .cs files that are supposed to be compiled once, when the Website is first accessed.
But when the solution is set up as a Web Application Project, the service is encapsulated in a dll assembly. In my case, the service is in a DLL called PPTWebsite.Web.dll. When I build the solution, the Silverlight application is also wrapped in a xap file called PPTWebsite.xap and from what I've read, the xap file and the WCF Web service assembly have to be in the same folder on the Website, and further, the xap file has to be in the ClientBin folder off the root of the Website, so that's also where the PPTWebsite.Web.dll file must be located. (I've tried putting the xap file in the root of the Website and that doesn't work at all.)
When I build my solution, a .svc file also gets created that identifies the location of the C# source file containing my Web service. This .svc file must be in the root of the Website and contains the following line:
<%@ ServiceHost Language="C#" Debug="true" Service="PPTWebsite.Web.PHDWebsiteService" CodeBehind="~/ClientBin/PHDWebsiteService.svc.cs" >
What confuses me is that the value of CodeBehind points to the C# source file containing the source of my service implementation but doesn't identify the assembly containing its CIL code. So: how does the Silverlight application know where the code for the Web service is stored when it makes calls to it?
I should also make clear that I have no problem communicating with the Web service when I execute everything from within VS2010. Everything is working perfectly when executed within the IDE.
The reason this is an issue is because when I deploy everything to the actual Website, the Silverlight application is not communicating with the Web service. I know this is true because I stripped down one of the services to a one line function that simply returns true and when the Silverlight event handler gets control it immediately throws an exception with the text, "The remote server returned an error: NotFound." (Google for that text and you will get thousands of hits on forums like this one, and the scary part is that most of the reported problems never seem to get resolved.)
Actually I don't think my problem is related to whether the solution is a Web Application Project or a Web Site, because originally I had a Web Site solution and got the same error. But for now, I'd just like to understand how Silverlight is supposed to talk to the Web server, given the contents of an svc file that only identifies a C# source file containing the service when what gets deployed is a DLL.
Solution: I just tried removing the CodeBehind attribute and the Silverlight application still correctly accessed the service. The CodeBehind attribute plays no part in finding the service, at least in a Silverlight Web Application Project. What is critical is the location of the service assembly relative to the .svc file: apparently it must be in a bin folder off the folder containing the .svc file.
modified on Wednesday, May 19, 2010 1:44 PM
|
|
|
|
|
Not sure what your question is - the ServiceReferences.ClientConfig file contains information that is used to find the web service.
Hope that helps.
|
|
|
|
|
Abhinav S wrote: Not sure what your question is
I tried to make that clear by displaying my question in italics: how does the Silverlight application know where the code for the Web service is stored when it makes calls to it?
Abhinav S wrote: the ServiceReferences.ClientConfig file contains information that is used to find the web service.
The ServiceReferences.ClientConfig file has a client endpoint element defined which of course has an address attribute. Since making my first post in this thread I've been trying to figure out the answer to my question myself. As near as I can figure out, the service needs to be in a folder named bin that is relative to the endpoint address. When VS2010 makes a new Silveright Web Application project, it places the .svc in the root of localhost, or the root of your project. Then when you build the project, the service assembly winds up in the bin folder off the .Web project.
So presumably when you deploy all this to a live Website, the .svc file goes into the root of the Website and the service assembly goes into a directory called bin that lies off the root of the Website. So I did this and now for the first time since I tried accessing my service from the Website itself, everything works!
I've been pulling my hair out over this for two extremely frustrating and depressing weeks and was ready to bring a consulting firm into my house for $250 an hour to solve my problem. I suspected it would only taken an expert five minutes to find out what was wrong because my Web Application project had no problem at all contacting my service when everything was run from my local PC. And I was right! Once I understood what is written in the previous paragraph, it took me all of two minutes to solve my problem!
Judging from the number of unanswered threads about this on the Web, there seems to be a huge problem of being able to contact the service perfectly fine when the project is executed from within VS2010 and failing miserably when it is deployed to the live Website. Tons of unanswered questions are out there! I really feel for all these people, because until this morning I've been suffering from the same misery for the last two weeks!
However, even though my real concern is now satisfied, I'm not going to mark this thread as SOLVED because my question wasn't "how do I connect to my service when it is located in my live Website," but how does the Silverlight application know where the code for the Web service is stored when it makes calls to it?
You see, I'm still not sure what the answer to this question is or what the CodeBehind attribute in the .svc has to do with anything, since it doesn't point to anything at all that exists (explicitly) on the Website! So my question is more related to how all the plumbing works rather than about a problem I'm still having. Once I have the answer to this question, I should probably write a Code Project article on how to manually deploy Web Application Projects, since judging from the horrendous amount of unanswered threads on the Web asking this question, more easy to follow instructions on how to do this are sorely needed.
|
|
|
|