|
|
Add the following to the configutation section of the web.config file in the service's application. It should give you more information to debug.
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "c:\log\Traces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
<div style="font-size:smaller;">
I didn't get any requirements for the signature
</div>
|
|
|
|
|
Guys, I have been coding asp.net for almost 10 years now. I'm just finishing up my first production silver light application. It is a small application that I have spent a 10 days doing what I could have done in ASP.Net in one day. Personally, I like the WPF part of SilverLight an awful lot, but all the asynchronous service calls and magic (generated proxies etc...) to get Silver Light to work is mind boggling.
Yes, the UI is a bit quicker than my ASP.Net pages, but the amount of work to make it nice and the amount of hassle to get it working just doesn't seem worth it to me. What do you all think is the best platform to use for corporate LOB applications considering I can pretty much do whatever I want.
Oh, I will say this, regardless of what I choose to use in the future, I have learned a sh*t ton in the last two weeks about how to use events, delegates and Lamda Syntax. Also, I hate the lamda syntax for events. It makes reading code so confusing. I don't mind writing out a few extra lines of code, at least my brain doesn't hurt when I read it.
I didn't get any requirements for the signature
|
|
|
|
|
Well, WPF & Silverlight do have a rather large learning curve. Both also require you to change how you think when you write apps. If you tried to write a Silverlight app in an ASP.Net'ish way, yeah, it would suck. Just as if you tried to write a WPF app in a Winforms/MFC'ish way.
Both WPF & Silverlight are designed to be used with the MVVM pattern.
If you are using them in the "old school way", you aren't using them right .
Once you master data binding & XAML & triggers & events & control templates & styles, etc., your codebase will shrink by like 50% or more.
Lots of things that you had to implement in hackish ways in Winforms / ASP.NET are magically free in WPF / Silverlight.
I was recently offered a job by a well known and awesome company, but turned it down because it meant going back to C++ / MFC. No freakin way man! .
|
|
|
|
|
No, I understand they are nothing like ASP.Net. While I agree the overall code base would shrink, that doesn't help me much. I always get stuff done way to quickly in ASP.Net. I actually don't mind writing a bit more code when it is easier to understand / follow. Also, I think coding the tricky stuff is much more tricky in Silverlight.
I didn't get any requirements for the signature
|
|
|
|
|
Yeah, some stuff that was super trivial pre-Silverlight / WPF is now overly complicated. Something that took you one line of code in ASP.NET could take several hundred (or more) in Silverlight / WPF. Thats only a few specific areas though IMO. More often the case will be that something that took thousands of lines pre-Silverlight / WPF now takes one line.
If you use MVVM, I think you will find your code is amazingly clean and readable.
HOWEVER, be warned... MVVM has an initial "start up cost" and learning curve like Silverlight did. By "start up cost", I mean WPF and Silverlight don't give you everything you need to do MVVM out of the box. There are lots of libraries out there that fill in the holes.
Anyways... once you get past the initial learning curve of Silverlight & MVVM, the payoffs are huge. Lots of things that are easy in Silverlight / WPF can't even be done otherwise.
Once you truly harness the power of data binding, you'll wonder how you ever got along without it.
It would certainly behoove you to write a "MyBagOfTricks.dll" type assembly where you stick the "tricky" stuff in generic / reusable ways and take it with you from job to job and build it up over the years.
|
|
|
|
|
Thanks for replying. I want to harness the power of data binding, but please tell me, how do I debug the binding when the result on the page (or user control) is not what I expect?
<div style="font-size:smaller;">
I didn't get any requirements for the signature
</div>
|
|
|
|
|
May I suggest that you use, as the basis of your projects, the library that Marlon Grech and I wrote called MefedMVVM[^]? With it, you can create views in Blend with design time view models. A design time view model is one that displays data in the designer so you can see what your application looks like in a simulated runtime environment while you are actually developing it.
|
|
|
|
|
I'll check it out. Thanks.
<div style="font-size:smaller;">
I didn't get any requirements for the signature
</div>
|
|
|
|
|
I just read this <a href="http://forums.silverlight.net/forums/p/159237/356897.aspx">rant</a> and I find myself agreeing. Holy sh*t, adding a button click event and selected index changed event to xaml.cs makes things SO much easier. I don't feel like I am losing anything by doing this. I'm not using any Unit Test, for I have Business Analyst who does real testing via the UI. So, why do I have do I have keep code out of the xaml.cs?
<div style="font-size:smaller;">
I didn't get any requirements for the signature
</div>
|
|
|
|
|
This is more a thought for the Lounge than a question though.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
Yes, it is.
I didn't get any requirements for the signature
|
|
|
|
|
I am using Adorners to show input errors on my textbox controls, and those controls are hosted within a ScrollViewer. For some reason, my adorner UI is clipped when it tries to draw outside the ScrollViewer.
I'm not the first to have this problem
http://social.msdn.microsoft.com/forums/en-US/wpf/thread/e060205e-5bfc-4f21-bf80-dfa55c44eb8a
However, the posted solution does not work for me... Has anyone else run into this problem?
Here's the XAML from my example project:
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300" Loaded="Window_Loaded">
<Window.Resources>
<Style TargetType="{x:Type ScrollViewer}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollViewer}">
<Grid x:Name="Grid" Background="{TemplateBinding Background}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Rectangle x:Name="Corner" Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Grid.Column="1" Grid.Row="1"/>
<AdornerDecorator Grid.Column="0" Grid.Row="0">
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False"/>
</AdornerDecorator>
<ScrollBar x:Name="PART_VerticalScrollBar" Cursor="Arrow" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Grid.Column="1" Grid.Row="0" ViewportSize="{TemplateBinding ViewportHeight}" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Value="{Binding Path=VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" AutomationProperties.AutomationId="VerticalScrollBar"/>
<ScrollBar x:Name="PART_HorizontalScrollBar" Cursor="Arrow" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Grid.Column="0" Grid.Row="1" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Value="{Binding Path=HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" AutomationProperties.AutomationId="HorizontalScrollBar"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<ScrollViewer Margin="50">
<TextBox Text="aaa" Height="23" Name="textBox1" Width="120" />
</ScrollViewer>
</Window>
I attach an adorner to the TextBox, but when that adorner draws outside the ScrollViewer window it gets clipped.
Thanks,
Aaron
|
|
|
|
|
Well, yeah, why wouldn't it? You aren't giving it anything bigger to draw on. The ScrollViewer is at the top.
|
|
|
|
|
Sorry if I'm not understanding. There is room outside the ScrollViewer for the adorner to draw on. Also, I don't have this problem with any other container type. If I host the textbox inside a Canvas or Grid, the adorner is not clipped and draws outside the container.
|
|
|
|
|
GetAdornerLayer() returns the FIRST AdornerLayer it finds (from the bottom up). HOWEVER (and I neglected to mention this before , sorry), in some situations it will find one lower then you expect. An AdornerDecorator is one situation, but, tee-hee... a ScrollViewer is another special case . ScrollContentPresenter is another control that'll stop the adorner layer search.
Here is GetAdornerLayer():
public static AdornerLayer GetAdornerLayer(Visual visual)
{
if (visual == null)
{
throw new ArgumentNullException("visual");
}
for (Visual visual2 = VisualTreeHelper.GetParent(visual) as Visual; visual2 != null; visual2 = VisualTreeHelper.GetParent(visual2) as Visual)
{
if (visual2 is AdornerDecorator)
{
return ((AdornerDecorator) visual2).AdornerLayer;
}
if (visual2 is ScrollContentPresenter)
{
return ((ScrollContentPresenter) visual2).AdornerLayer;
}
}
return null;
}
As you can see, it stops once it hits the ScrollContentPresenter .
If you want a larger adorner layer, you'd need to call GetAdornerLayer() on a Visual above the ScrollViewer.
|
|
|
|
|
You're a genius!! I rewrote the GetAdornerLayer function to be this:
public AdornerLayer GetAdornerLayer(Visual visual)
{
if (visual == null)
{
throw new ArgumentNullException("visual");
}
for (Visual visual2 = VisualTreeHelper.GetParent(visual) as Visual; visual2 != null; visual2 = VisualTreeHelper.GetParent(visual2) as Visual)
{
if (visual2 is AdornerDecorator)
{
return ((AdornerDecorator)visual2).AdornerLayer;
}
//if (visual2 is ScrollContentPresenter)
//{
//return ((ScrollContentPresenter)visual2).AdornerLayer;
//}
}
return null;
}
Works like a charm!! Thanks for your help.
Aaron
|
|
|
|
|
Not what I would have done, but whatever works
You could have just called GetAdornerLayer() on the ScrollViewer instead of the TextBlock.
|
|
|
|
|
Hello,
How is it possible to expose a collection (Which gets populated in the windows service) i.e. a queue to a silverlight page using wcf ?
I have not been able to find this on the web anywhere.
Any thoughts please?
Thnk you
|
|
|
|
|
Just expose your data via a web service and have your Silverlight application call it that way.
Just remember that Silverlight can only talk async web services.
|
|
|
|
|
|
New to Silver light stuff getting this error when Installing Silver light tool for Visual Studio 2008
any suggestion ?
Fatal error during Installations
Exe (c:\d291c2132eaf0c9e83a1e7\PurgeSLTCache.exe) succeeded.
Exe (C:\DOCUME~1\MIRZA~1.COM\LOCALS~1\Temp\Silverlight Tools RTW\Silverlight.2.0_Developer.exe) failed with 0x80070643 - Fatal error during installation. .
Exe (c:\d291c2132eaf0c9e83a1e7\PurgeSLTCache.exe) succeeded.
Final Result: Installation failed with error code: (0x80070643), Fatal error during installation
SOFTDEV
Luck in life always exists in the form of an abstract class that cannot be instantiated directly and needs to be inherited by hard work and dedication.
modified on Sunday, January 9, 2011 2:48 AM
|
|
|
|
|
Just reinstalled the latest version and installed this version and again updated to the latest :P
SOFTDEV
Luck in life always exists in the form of an abstract class that cannot be instantiated directly and needs to be inherited by hard work and dedication.
|
|
|
|
|
Hi. Good day to all.
I am stucked with this problem:
I have multiple storyboards, for example, Move1 as the first storyboard name. I used the ControlStoryBoardAction - StoryBoardCompletedTrigger to continue with the next storyboard which is Move2. And this goes on till Move20. Now, I need to have a stop button which will stop whichever storyboard that is playing at the time when the stop button is being clicked. I tried a lot of methods which none works.
Another problem:
I need a repeat button too. I researched on many methods that teaches to refresh the page but it doesn't seem to work in my case.
Any advise on how to go about doing? Thanks!
|
|
|
|
|
For the first problem, the simplest solution would be to run a loop through all the story boards (on clicking the stop button) and stop all the story boards that are running.
Silverlight does not support a page refresh.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|