Search Results

Search found 6091 results on 244 pages for 'wpf storyboard'.

Page 17/244 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • WPF issue: Showing HTML <DIV> on top of WPF app

    - by Kangkan
    Hi, I am new to WPF. We are facing one issue. We are showing/launching a WPF browser application from an web (ASPX) application. The web application has a navigator menu with drop-downs (on hover). It works fine till the user is using the web application (aspx pages). But once the WPF application is launched (and is in the foreground on the aspx page) the dropdown menus that are on top of the WPF app is shown below the WPF application. The drop downs are in a <div> and we tried to put the ZINDEX value. But could not get any positive reply. Can somebody help?

    Read the article

  • WPF Alphabet (Available for download)

    - by mbcrump
    WPF Alphabet is a application that I created to help my child learn the alphabet. It displays each letter and pronounces it using speech synthesis. It was developed using WPF and c# in about 3 hours (so its kinda rough). I went ahead and uploaded it to codeplex for those in similar situation or just wanting to see a particular WPF feature. I would also recommend Scott Hanselman’s BabySmash!. Specific WPF Features: DispatcherTimer (WPF) SpeechSynthesizer (WPF) URL Navigate (WPF) not PAGE XAML Examples: DockPanel Border TextBlock HyperLink Button's and Events Download full source and binaries here.

    Read the article

  • Databinding between 2 Dependency Properties

    - by stefan.at.wpf
    Hello, I'm trying to do databinding between 2 Dependency Properties. I guess this should be quite easy, anyways I just don't get it. I already googled but I couldn't really find out what I'm doing wrong. I'm trying to bind the ControlPointProperty to the QuadraticBezierSegment.Point1Property, however it doesn't work. Thanks for any hint! class DataBindingTest : DependencyObject { // Dependency Property public static readonly DependencyProperty ControlPointProperty; // .NET wrapper public Point ControlPoint { get { return (Point)GetValue(DataBindingTest.ControlPointProperty); } set { SetValue(DataBindingTest.ControlPointProperty, value); } } // Register Dependency Property static DataBindingTest() { DataBindingTest.ControlPointProperty = DependencyProperty.Register("ControlPoint", typeof(Point), typeof(DataBindingTest)); } public DataBindingTest() { QuadraticBezierSegment bezier = new QuadraticBezierSegment(); // Binding Binding myBinding = new Binding(); myBinding.Source = ControlPointProperty; BindingOperations.SetBinding(bezier, QuadraticBezierSegment.Point1Property, myBinding); // Test Binding: Change the binding source ControlPoint = new Point(1, 1); MessageBox.Show(bezier.Point1.ToString()); // gives (0,0), should be (1,1) } }

    Read the article

  • WPF: Reloading app parts to handle persistence as well as memory management.

    - by Ingó Vals
    I created a app using Microsoft's WPF. It mostly handles data reading and input as well as associating relations between data within specific parameters. As a total beginner I made some bad design decision ( not so much decisions as using the first thing I got to work ) but now understanding WPF better I'm getting the urge to refactor my code with better design principles. I had several problems but I guess each deserves it's own question for clarity. Here I'm asking for proper ways to handle the data itself. In the original I wrapped each row in a object when fetched from database ( using LINQ to SQL ) somewhat like Active Record just not active or persistence (each app instance had it's own data handling part). The app has subunits handling different aspects. However as it was setup it loaded everything when started. This creates several problems, for example often it wouldn't be neccesary to load a part unless we were specifically going to work with that part so I wan't some form of lazy loading. Also there was problem with inner persistance because you might create a new object/row in one aspect and perhaps set relation between it and different object but the new object wouldn't appear until the program was restarted. Persistance between instances of the app won't be huge problem because of the small amount of people using the program. While I could solve this now using dirty tricks I would rather refactor the program and do it elegantly, Now the question is how. I know there are several ways and a few come to mind: 1) Each aspect of the program is it's own UserControl that get's reloaded/instanced everytime you navigate to it. This ensures you only load up the data you need and you get some persistancy. DB server located on same LAN and tables are small so that shouldn't be a big problem. Minor drawback is that you would have to remember the state of each aspect so you wouldn't always start at beginners square. 2) Having a ViewModel type object at the base level of the app with lazy loading and some kind of timeout. I would then propegate this object down the visual tree to ensure every aspect is getting it's data from the same instance 3) Semi active record data layer with static load methods. 4) Some other idea What in your opinion is the most practical way in WPF, what does MVVM assume?

    Read the article

  • Should I learn WPF? Is it a good time investment? [closed]

    - by Arash
    First I should say this is a copy of this question. I am a C# developer, not an expert, but still learning and growing. I want to learn WPF so I can creat application with nice UI. However I am afraid that, after I spend my time learning it, it is gonna be obselete, you know with windows 8 and metro application and stuff, so my question is: At this pint of time, would it be a good time investment to learn WPF? or will I be better off learning Metro? Thanks.

    Read the article

  • WPF: Animating TranslateTransform from code

    - by ghostskunks
    I have a WPF canvas on which I'm dynamically creating objects from code. These objects are being transformed by setting the RenderTransform property, and an animation needs to be applied one of those transforms. Currently, I can't get properties of any transform to animate (although no exception gets raised and the animation appears to run - the completed event gets raised). In addition, if the animation system is stressed, sometimes the Storyboard.Completed event is never raised. All the examples I've come accross animate the transforms from XAML. MSDN documentation suggests that the x:Name property of a transform must be set for it to be animatable, but I haven't found a working way to set it from code. Any ideas? Here's the full code listing that reproduces the problem: using System; using System.Diagnostics; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; namespace AnimationCompletedTest { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { Canvas panel; public MainWindow() { InitializeComponent(); MouseDown += DoDynamicAnimation; Content = panel = new Canvas(); } void DoDynamicAnimation(object sender, MouseButtonEventArgs args) { for (int i = 0; i < 12; ++i) { var e = new Ellipse { Width = 16, Height = 16, Fill = SystemColors.HighlightBrush }; Canvas.SetLeft(e, Mouse.GetPosition(this).X); Canvas.SetTop(e, Mouse.GetPosition(this).Y); var tg = new TransformGroup(); var translation = new TranslateTransform(30, 0); tg.Children.Add(translation); tg.Children.Add(new RotateTransform(i * 30)); e.RenderTransform = tg; panel.Children.Add(e); var s = new Storyboard(); Storyboard.SetTarget(s, translation); Storyboard.SetTargetProperty(s, new PropertyPath(TranslateTransform.XProperty)); s.Children.Add( new DoubleAnimation(3, 100, new Duration(new TimeSpan(0, 0, 0, 1, 0))) { EasingFunction = new PowerEase {EasingMode = EasingMode.EaseOut} }); s.Completed += (sndr, evtArgs) => { Debug.WriteLine("Animation {0} completed {1}", s.GetHashCode(), Stopwatch.GetTimestamp()); panel.Children.Remove(e); }; Debug.WriteLine("Animation {0} started {1}", s.GetHashCode(), Stopwatch.GetTimestamp()); s.Begin(); } } [STAThread] public static void Main() { var app = new Application(); app.Run(new MainWindow()); } } }

    Read the article

  • Trouble animating RadialGradientBrush in WPF

    - by emddudley
    I'm trying to animate a RadialGradientBrush in my application. I get the super helpful exception: Additional information: 'System.Windows.Style' value cannot be assigned to property 'Style' of object 'System.Windows.Controls.Border'. '[Unknown]' property does not point to a DependencyObject in path '(0).(1).[0].(2)'. Error at object 'System.Windows.Style' in markup file 'Eng.Modules.Core;component/system/grid/systemgridview.xaml' Line 252 Position 51. I know it's something wrong with the indirect property targeting or partial path qualification in my DoubleAnimation's Storyboard.TargetProperty attribute. Any ideas? <Border> <Border.Resources> <RadialGradientBrush x:Key="SomeBrush"> <RadialGradientBrush.GradientStops> <GradientStop Color="White" Offset="0" /> <GradientStop Color="Gold" Offset="1" /> </RadialGradientBrush.GradientStops> </RadialGradientBrush> </Border.Resources> <Border.Style> <Style TargetType="{x:Type Border}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}}" Value="True"> <Setter Property="Background" Value="{StaticResource SomeBrush}" /> <DataTrigger.EnterActions> <BeginStoryboard x:Name="SomeStoryBoard"> <Storyboard> <!-- RIGHT HERE --> <DoubleAnimation Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)" From="0" To="1" Duration="0:0:1" RepeatBehavior="Forever" AutoReverse="True" /> </Storyboard> </BeginStoryboard> </DataTrigger.EnterActions> <DataTrigger.ExitActions> <RemoveStoryboard BeginStoryboardName="SomeStoryBoard" /> </DataTrigger.ExitActions> </DataTrigger> </Style.Triggers> </Style> </Border.Style> </Border>

    Read the article

  • WPF Choppy Animation

    - by Chris Dunaway
    WPF Windows-XP SP3 I'm having a problem with a simple WPF animation. I use the following Xaml code (in XamlPad and also in a WPF project): <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Border Name="MyBorder" BorderThickness="10" BorderBrush="Blue" CornerRadius="10" Background="DarkRed" > <Rectangle Name="MyRectangle" Margin="10" StrokeDashArray="2.0,1.0" StrokeThickness="10" RadiusX="10" RadiusY="10" Stroke="Black" StrokeDashOffset="0"> <Rectangle.Triggers> <EventTrigger RoutedEvent="Rectangle.Loaded"> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetName="MyRectangle" Storyboard.TargetProperty="StrokeDashOffset" From="0.0" To="3.0" Duration="0:0:1" RepeatBehavior="Forever" Timeline.DesiredFrameRate="30" /> </Storyboard> </BeginStoryboard> </EventTrigger> </Rectangle.Triggers> </Rectangle> </Border> </Page> It has the effect of causing the border to animate around the rectangle. After a fresh reboot of the machine, this animation is nice and smooth. However, I tend to leave my machine on all the time and after a period time elapses (I don't know how long), the animation starts stuttering and becomes choppy. I thought that it may be memory or resource issues, but after shutting down all other apps and any services that seem unnecessary, the stuttering still continues. However, after a system reboot, the animation is smooth again! I get the same symptoms in a WPF app or in XamlPad. In the case of the app, it doesn't seem to make any difference whether I run in the debugger or if I run the executable directly. I applied the patch at this link: http://support.microsoft.com/kb/981741 and I thought that it had taken care of the issue, but it seems not to have. I have seen some posts that might indicate that using transparency might affect animation, but as you can see, my xaml does not use transparency. Can anyone give me some suggestions on how to determine what the problem is? Are there any WPF diagnostic tools that might help? UPDATE: I have checked my video drivers and they are the latest version. (nVidia GeForce 8400 GS)

    Read the article

  • Blend Interaction Behaviour gives "points to immutable instance" error

    - by kennethkryger
    I have a UserControl that is a base class for other user controls, that are shown in "modal view". I want to have all user controls fading in, when shown and fading out when closed. I also want a behavior, so that the user can move the controls around.My contructor looks like this: var tg = new TransformGroup(); tg.Children.Add(new ScaleTransform()); RenderTransform = tg; var behaviors = Interaction.GetBehaviors(this); behaviors.Add(new TranslateZoomRotateBehavior()); Loaded += ModalDialogBase_Loaded; And the ModalDialogBase_Loaded method looks like this: private void ModalDialogBase_Loaded(object sender, RoutedEventArgs e) { var fadeInStoryboard = (Storyboard)TryFindResource("modalDialogFadeIn"); fadeInStoryboard.Begin(this); } When I press a Close-button on the control this method is called: protected virtual void Close() { var fadeOutStoryboard = (Storyboard)TryFindResource("modalDialogFadeOut"); fadeOutStoryboard = fadeOutStoryboard.Clone(); fadeOutStoryboard.Completed += delegate { RaiseEvent(new RoutedEventArgs(ClosedEvent)); }; fadeOutStoryboard.Begin(this); } The storyboard for fading out look like this: <Storyboard x:Key="modalDialogFadeOut"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="{x:Null}"> <EasingDoubleKeyFrame KeyTime="0" Value="1"> <EasingDoubleKeyFrame.EasingFunction> <BackEase EasingMode="EaseIn" Amplitude="0.3" /> </EasingDoubleKeyFrame.EasingFunction> </EasingDoubleKeyFrame> <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"> <EasingDoubleKeyFrame.EasingFunction> <BackEase EasingMode="EaseIn" Amplitude="0.3" /> </EasingDoubleKeyFrame.EasingFunction> </EasingDoubleKeyFrame> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="{x:Null}"> <EasingDoubleKeyFrame KeyTime="0" Value="1"> <EasingDoubleKeyFrame.EasingFunction> <BackEase EasingMode="EaseIn" Amplitude="0.3" /> </EasingDoubleKeyFrame.EasingFunction> </EasingDoubleKeyFrame> <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"> <EasingDoubleKeyFrame.EasingFunction> <BackEase EasingMode="EaseIn" Amplitude="0.3" /> </EasingDoubleKeyFrame.EasingFunction> </EasingDoubleKeyFrame> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="{x:Null}"> <EasingDoubleKeyFrame KeyTime="0" Value="1" /> <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0" /> <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0" /> </DoubleAnimationUsingKeyFrames> </Storyboard> If the user control is show, and the user does NOT move it around on the screen, everything works fine. However, if the user DOES move the control around, I get the following error when the modalDialogFadeOut storyboard is started: 'Children' property value in the path '(0).(1)[0].(2)' points to immutable instance of 'System.Windows.Media.TransformCollection'. How can fix this?

    Read the article

  • Visualising a 'Smarties' lid using XAML (WPF/Silverlight, Visual Studio/Blend)

    - by Mr. Disappointment
    Hi folks, First off, to clarify something in the title which could well be ambiguous/misleading, I'd like to inform you of my definition of 'Smarties', as I know often products are available all over - only under a different alias. Smarties are a candy product in the UK, little chocolate drops covered in a crispy shell which are distributed in a card tube, this tube used to have a plastic lid/top with an individual letter on the underside (they've taken a more economical approach as of late), the lid/top of the old-style tube is the main element of this question. Familiarisation Link Lid View Link Okay, now with the seller-type pitch out of the way (no, I don't work for Nestlé ;)), hopefully the question is becoming rather clear. Essentially, I'd like to recreate one of these lids using XAML, ultimately to be utilised in a Silverlight web application. That is, I'd like to result in a reusable control, of which the following is true: It looks like a Smarties lid. The colour can be specified. The letter can be specified. The control can be rotated to display either side. The second two seem trivial, but we must bare in mind that the background colour specified will almost, if not always, be the same as the foreground, leaving a visibility issue where the character content is concerned; as for the rotation, I'm hoping this kind of functionality is reasonably available, and acceptable to implement. So, to put this out there, consider a control named SmartiesLid which derives from ToggleButton (appropriate?) and further plotted out using a style in a resource dictionary which applies to it, as follows: <Style TargetType="local:SmartiesLid"> <Setter Property="Background" Value="Red"/> <Setter Property="Foreground" Value="Red"/> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="HorizontalContentAlignment" Value="Center"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:SmartiesLid"> <Grid x:Name="LayoutRoot"> <Grid.ColumnDefinitions> <ColumnDefinition Width=".05*"/> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition Width=".05*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height=".05*"/> <RowDefinition/> <RowDefinition/> <RowDefinition Height=".05*"/> <RowDefinition Height=".1*"/> </Grid.RowDefinitions> <Ellipse Grid.RowSpan="4" Grid.ColumnSpan="4" Fill="{TemplateBinding Background}" Stroke="Transparent"/> <Ellipse Grid.RowSpan="2" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1" Fill="{TemplateBinding Background}" Stroke="Transparent"> <Ellipse.Effect> <DropShadowEffect Direction="280" ShadowDepth="6" BlurRadius="6"/> </Ellipse.Effect> </Ellipse> <TextBlock Grid.RowSpan="2" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1" Name="LetterTextBlock" Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" FontSize="190" HorizontalAlignment="Center" VerticalAlignment="Center"> </TextBlock> <!-- <Path Stretch="Fill" Grid.Row="3" Grid.RowSpan="2" Grid.Column="1" Grid.ColumnSpan="2" Fill="Black" Data="..."> How to craw the lid 'tab'? </Path> --> </Grid> <ControlTemplate.Resources> <TranslateTransform x:Key="IndentTransform" X="10" /> <RotateTransform x:Key="RotateTransform" Angle="0" /> <Storyboard x:Key="MouseOver"> </Storyboard> <Storyboard x:Key="MouseLeave"> </Storyboard> </ControlTemplate.Resources> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="true"> <Trigger.EnterActions> <BeginStoryboard Storyboard="{StaticResource MouseOver}"/> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard Storyboard="{StaticResource MouseLeave}"/> </Trigger.ExitActions> </Trigger> <Trigger Property="IsPressed" Value="true"> <Setter TargetName="LayoutRoot" Property="RenderTransform" Value="{StaticResource IndentTransform}"/> </Trigger> <Trigger Property="IsChecked" Value="true"> <Setter TargetName="LayoutRoot" Property="RenderTransform" Value="{StaticResource RotateTransform}"/> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="Gray"/> <Setter Property="Opacity" Value="0.5"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> With this in mind, can anyone give input on, in decreasing order of my incompetence in an area: Designing the overall look and feel of the damn thing (I'm no designer, and while I could hack away at this single control for days and potentially get something relatively useful, it's always a gamble). The particular barrier for me here is 'pathing' the tab of the lid, as you will see in the XAML as an element commented out. Should Path be used, or would it be more appropriate to transform a rectangle with rounded corners, or any specific suggestions? Bevelling the individually displayed letter; as detailed above, when the colour of both the foreground and background are the same then this will be invisible if no effects are applied, also for a decent level of realism I'd like to be able to apply such an effect/s. So far use of DropShadow and Balder3DEngine have fulfilled my requirements for graphics in XAML, how achievable is a bevel effect? Rotating the control on mouse-click, that is, showing the opposing face. Is this going to be possible using a style and XAML only for the design? Or is it that ugliness may rear it's head in the form of code-behind to show/hide embedded controls? Should the faces be separate controls and later somehow combined? Allowing the control to size dynamically. I'm supposing I will be able to convert a solid, absolute layout to a nice generic one when I actually have the former in place. Obviously this entails sizing the centralised letter and the lid 'tab', but that's it really, other than keeping the aspect ratio equal (since the ellipses grow nicely with the grid). Any suggestions to approaching this would be greatly appreciated, particularly with a dynamically growing font - I've done that before in a web-imaging scenario using code and System.Drawing, and wouldn't like to approach it in even a similar way. By the way, the reason I specify both WPF and Silverlight is that, from my current knowledge, the inputs being written targeting either of these will be fairly transferable for similar output by the other, albeit not without alterations in either scenario. The resulting application is in fact destined to be written in Silverlight, however, so I don't fancy inviting anything from WPF which will guarantee my only being able to convert 90% of it. I'll go give this little project a start, maybe in Blend(?), hopefully can catch up with some advice shortly. Thanks, Mr. D EDIT: Next question, ought this to be broken up into separate questions? :/

    Read the article

  • Using WPF and SlimDx (DirectX 10/11)

    - by slurmomatic
    I am using SlimDX with WinForms for a while now, but want to make the switch to WPF now. However, I can't figure out how to get DX10/11 working with WPF. The February release of SlimDX provides a WPF example, which only works with DX 9 though. I found the following solution: http://jmorrill.hjtcentral.com/Home/tabid/428/EntryId/437/Direct3D-10-11-Direct2D-in-WPF.aspx but can't get it to work with SlimDX. My main problem is the shared resource handle as I don't know how to retrieve the shared handle from a SlimDX texture. I can't find any information to this topic. In C++ the code looks like this: HRESULT D3DImageEx::GetSharedHandle(IUnknown *pUnknown, HANDLE * pHandle) { HRESULT hr = S_OK; *pHandle = NULL; IDXGIResource* pSurface; if (FAILED(hr = pUnknown->QueryInterface(__uuidof(IDXGIResource), (void**)&pSurface))) return hr; hr = pSurface->GetSharedHandle(pHandle); pSurface->Release(); return hr; } Basically, what I want to do (because I think that this is the solution), is to share a texture between a Direct3d9DeviceEx (for rendering the WPF D3DImage) and a Direct3d10Device (a texture render target for my scene). Any pointers in the right direction are greatly appreciated.

    Read the article

  • bind a WPF datagrid to a datatable

    - by Jim Thomas
    I have used the marvelous example posted at: http://www.codeproject.com/KB/WPF/WPFDataGridExamples.aspx to bind a WPF datagrid to a datatable. The source code below compiles fine; it even runs and displays the contents of the InfoWork datatable in the wpf datagrid. Hooray! But the WPF page with the datagrid will not display in the designer. I get an incomprehensible error instead on my design page which is shown at the end of this posting. I assume the designer is having some difficulty instantiating the dataview for display in the grid. How can I fix that? XAML Code: xmlns:local="clr-namespace:InfoSeeker" <Window.Resources> <ObjectDataProvider x:Key="InfoWorkData" ObjectType="{x:Type local:InfoWorkData}" /> <ObjectDataProvider x:Key="InfoWork" ObjectInstance="{StaticResource InfoWorkData}" MethodName="GetInfoWork" /> </Window.Resources> <my:DataGrid DataContext="{Binding Source={StaticResource InfoWork}}" AutoGenerateColumns="True" ItemsSource="{Binding}" Name="dataGrid1" xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit" /> C# Code: namespace InfoSeeker { public class InfoWorkData { private InfoTableAdapters.InfoWorkTableAdapter infoAdapter; private Info infoDS; public InfoWorkData() { infoDS = new Info(); infoAdapter = new InfoTableAdapters.InfoWorkTableAdapter(); infoAdapter.Fill(infoDS.InfoWork); } public DataView GetInfoWork() { return infoDS.InfoWork.DefaultView; } } } Error shown in place of the designer page which has the grid on it: An unhandled exception has occurred: Type 'MS.Internal.Permissions.UserInitiatedNavigationPermission' in Assembly 'PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not marked as serializable. at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) ...At:Ms.Internal.Designer.DesignerPane.LoadDesignerView()

    Read the article

  • WPF DataGrid style Silverlight DataGrid?

    - by Shimmy
    That's not a secret: Silverlight's DataGrid default style is beautiful while WPF's is poor. Instead of reinventing the wheel let me ask the community if anyone has copied the SL styles to use in WPF. Silverlight default-style DataGrid: WPF default-style DataGrid (updated after Saied K's answer):

    Read the article

  • Learning WPF and MVVM - best approach for learning from scratch

    - by bplus
    Hello, I've got about three years c# experience. I'd like to learn some WPF and the MVVM pattern. There are a lot of links to articles on this site but I'm getting a little overwhelmed. Would a sensible approach for a begginer to be forget mvvm for a while and just quickly learn a bit a of WPF, then come back to MVVM? I had a leaf through this book in work today, it doesn't seem to mention MVVM (at least not in the index). I was pretty surprised by this as I thought MVVM was supposed to be the "lingua franca" of WPF? Also I've just started working at a new company and they are using MVVM with WinForms, has anyone come across this before? Can anyone recommend a book that will teach me both WPF and MVVM?

    Read the article

  • WPF: Adorner Hit Testing / MouseDown Event

    - by stefan.at.wpf
    Hello, I have an Adorner which adornes a Border (please see screenshot below). The MouseDown Event for the Adorner is however only raised, when clicking on an element in the adorner. I need the MouseDown Event to be raised, when clicking on any place in the adorner above the adorned element. How can this be done? Do I have to add an transparent control in the adorner or is there another way for this? Thanks for any help! Screenshot and VS 2008 Project: http://cid-0432ee4cfe9c26a0.skydrive.live.com/browse.aspx/%C3%96ffentlich?uc=2 The Code for the adorner: class myAdorner : Adorner { public myAdorner(UIElement element) : base(element) { this.MouseDown += new System.Windows.Input.MouseButtonEventHandler(myAdorner_MouseDown); } void myAdorner_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { MessageBox.Show("ok"); } // Draws two rectangles: one in the upper-left and another one in the lower-right corner protected override void OnRender(System.Windows.Media.DrawingContext drawingContext) { Size size = this.AdornedElement.RenderSize; Rect r1 = new Rect(0.5, 0.5, 20, 20); Rect r4 = new Rect(size.Width - 20.5, size.Height - 20.5, 20, 20); SolidColorBrush brush = new SolidColorBrush(Colors.AliceBlue); Pen pen = new Pen(Brushes.Black, 1); drawingContext.DrawRectangle(brush, pen, r1); drawingContext.DrawRectangle(brush, pen, r4); } }

    Read the article

  • Any free WPF themes?

    - by TimothyP
    Duplicate: Where can I find free WPF controls and control templates? I'm not a designer, so I'm looking for some free WPF themes. Where can I find some good WPF themes?

    Read the article

  • WPF: OnRender and Hit Testing

    - by stefan.at.wpf
    Hello, when using OnRender to draw something on the screen, is there any way to perform Hit Testing on the drawn graphics? Sample Code protected override void OnRender(System.Windows.Media.DrawingContext drawingContext) { base.OnRender(drawingContext); drawingContext.DrawRectangle(Brushes.Black, null, new Rect(50, 50, 100, 100)); } Obviously one has no reference to the drawn Rectangle which would be necessary to perform hit testing or am I wrong about this? I know I can use DrawingVisual, I'm just curious if my understanding is correct, that using OnRender to draw something you can't perform any hit testing on the drawn things?

    Read the article

  • Validation of WPF User Input using MVVM and Entity Framework 4.0

    - by Emad
    I am building a WPF 4.0 Application using MVVM. The Model is generated using Entity Framework 4.0. I am using Data binding on the WPF to bind the user input to model properties. What is the easiest way to validate user input ? I prefer an approach where I can set the validation rules on the Model rather than on the WPF itself. How can this be done? Any samples are appreciated.

    Read the article

  • WPF Binding Error reported when Binding appears to work fine

    - by Noldorin
    I am trying to create a custom TabItem template/style in my WPF 4.0 application (using VS 2010 Pro RTM), but inspite of everything seeming to work correctly, I am noticing a binding error in the trace window. The resource dictionary XAML I use to style the TabItems of a TabControl is given in full here. (Just create a simple TabControl with several items and apply the given ResourceDictionary to test it out.) Specifically, the error is occurring due to the following line (discovered through trial and error testing, since Visual Studio isn't actually reporting it at design tim <TranslateTransform X="{Binding ActualWidth, ElementName=leftSideBorderPath}"/> The full error given in the trace (Ouput window) is the following: System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=ActualWidth; DataItem=null; target element is 'TranslateTransform' (HashCode=35345840); target property is 'X' (type 'Double') The error occurs on load and is repeated 5 times then (note that I have 3 tab items in my example). It also occurs consistently and repeatedly whenever for the Window is resized, for example - filling the Output window. Perhaps every time the TabItem layout is updated? And again, though it is not reported, the error very much seems to be due to the fact that I am binding to any element at all, not specifically leftSideBorderPath or the the ActualWidth propertry. For example, changing this line to the following fixes things. <TranslateTransform X="25"/> Unfortunately, hard-coding the value isn't really an option. This issue seems very strange to me in that the binding does appear to be giving the correct results. (Inspecting the X value of the TranslateTransform at runtime clearly shows the correct bound value, and the ClipGeometry when viewed is exactly what it hsould be.) Neither Visual Studio nor WPF seems to be giving me any more information on the cause of the error perhaps (setting PresentationTraceSources.TraceLevel to High doesn't help), yet the fact that things are working despite the error being reported inclines me to think that this is some fringe-case WPF bug. As a side note, the Visual Studio WPF designer and XAML editor are giving me a problem with the following line: <PathGeometry Figures="{Binding Source={StaticResource TabSideFillFigures}}"/> Although WPF (at runtime) is perfectly happy binding Figures to the TabSideFillFigures string, with the Binding enforcing the use of the TypeConverter, the XAML editor and WPF designer are complaining. All the XAML code for the ControlTemplate is underlined and I get the following errors in the Error List: Error 9 '{DependencyProperty.UnsetValue}' is not a valid value for the 'System.Windows.Controls.Control.Template' property on a Setter. C:\Users\Alex\Documents\Visual Studio 2010\Projects\Ircsil\devel\Ircsil\MainWindow.xaml 1 1 Ircsil Error 10 Object reference not set to an instance of an object. C:\Users\Alex\Documents\Visual Studio 2010\Projects\Ircsil\devel\Ircsil\Skins\Default\MainSkin.xaml 58 17 Ircsil Again, to repeat, everything works perfectly well at runtime, which is what makes this particularly odd... Could someone perhaps shed some light on these issues, in particular the first (which seems to be a potential WPF bug), and the latter (which seems to be a Visual Studio bug). Any sort of feedback or suggestions would be much appreciated!

    Read the article

  • How is "Esc" key handled in WPF Window?

    - by Markus2k
    I want the Escape key to close my WPF window. However if there is a control that can consume that Escape key, I don't want to close the Window. There are multiple solutions on how to close the WPF Window when ESC key is pressed. eg. http://stackoverflow.com/questions/419596/how-does-the-wpf-button-iscancel-property-work However this solution closes the Window, without regard to if there is an active control that can consume the Escape key.

    Read the article

  • Put MFC CDialog in a WPF form

    - by splintor
    Hi, We are porting an MFC application to WPF, and will probably won't have time to port the entire application. The MFC app has many CDialog-based windows, and we are thinking of leaving some of these windows in MFC, and show them inside a WPF window, so we can control their modality from WPF. Is there an easy way to accomplish that? If not, can you recommend another way to handle this? thanks, splintor

    Read the article

  • wpf and win32 overlapping issue

    - by priya-hatipkar
    I have a wpf Window, which has wpf control and windows forms control hosted in WindowsFormsHost. The expected behavior is that the WPF control should be rendered on top of WindowsFormsHost. Unfortunately, this is a limitation in the interop story, WindowsFormsHost elements are always drawn on top, and don't get affected by z-order. http://msdn.microsoft.com/en-us/library/ms742522.aspx Is there any workaround to solve this problem? Regards, Priya

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >