Search Results

Search found 10936 results on 438 pages for 'wpf controls'.

Page 22/438 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Transforming coordinates from an image control to the image source in WPF

    - by Gabriel
    I'm trying to learn WPF, so here's a simple question, I hope: I have a window that contains an Image element bound to a separate data object with user-configurable Stretch property <Image Name="imageCtrl" Source="{Binding MyImage}" Stretch="{Binding ImageStretch}" /> When the user moves the mouse over the image, I would like to determine the coordinates of the mouse with respect to the original image (before stretching/cropping that occurs when it is displayed in the control), and then do something with those coordinates (update the image). I know I can add an event-handler to the MouseMove event over the Image control, but I'm not sure how best to transform the coordinates: void imageCtrl_MouseMove(object sender, MouseEventArgs e) { Point locationInControl = e.GetPosition(imageCtrl); Point locationInImage = ??? updateImage(locationInImage); } Now I know I could compare the size of Source to the ActualSize of the control, and then switch on imageCtrl.Stretch to compute the scalars and offsets on X and Y, and do the transform myself. But WPF has all the information already, and this seems like functionality that might be built-in to the WPF libraries somewhere. So I'm wondering: is there a short and sweet solution? Or do I need to write this myself? EDIT I'm appending my current, not-so-short-and-sweet solution. Its not that bad, but I'd be somewhat suprised if WPF didn't provide this functionality automatically: Point ImgControlCoordsToPixelCoords(Point locInCtrl, double imgCtrlActualWidth, double imgCtrlActualHeight) { if (ImageStretch == Stretch.None) return locInCtrl; Size renderSize = new Size(imgCtrlActualWidth, imgCtrlActualHeight); Size sourceSize = bitmap.Size; double xZoom = renderSize.Width / sourceSize.Width; double yZoom = renderSize.Height / sourceSize.Height; if (ImageStretch == Stretch.Fill) return new Point(locInCtrl.X / xZoom, locInCtrl.Y / yZoom); double zoom; if (ImageStretch == Stretch.Uniform) zoom = Math.Min(xZoom, yZoom); else // (imageCtrl.Stretch == Stretch.UniformToFill) zoom = Math.Max(xZoom, yZoom); return new Point(locInCtrl.X / zoom, locInCtrl.Y / zoom); }

    Read the article

  • WPF 3D extrude "a bitmap"

    - by Bgnt44
    Hi, I'm looking for a way to simulate a projector in wpf 3D : i've these "in" parameters : beam shape : a black and white bitmap file beam size ( ex : 30 °) beam color beam intensity ( dimmer ) projector position (x,y,z) beam position (pan(x),tilt(y) relative to projector) First i was thinking of using light object but it seem that wpf can't do that So, now i think that i can make for each projector a polygon from my bitmap... First i need to convert the black and white bitmap to vector. Only Simple shape ( bubble, line,dot,cross ...) Is there any WPF way to do that ? Or maybe a external program file (freeware); then i need to build the polygon, with the shape of the converted bitmap , color , size , orientation in parameter. i don't know how can i defined the lenght of the beam , and if it can be infiny ... To show the beam result, i think of making a room ( floor , wall ...) and beam will end to these wall... i don't care of real light render ( dispersion ...) but the scene render has to be real time and at least 15 times / second (with probably from one to 100 projectors at the same time), information about position, angle,shape,color will be sent for each render... Well so, i need sample for that, i guess that all of these things could be useful for other people If you have sample code : Convert Bitmap to vector Extrude vectors from one point with a angle parameter until collision of a wall Set x,y position of the beam depend of the projector position Set Alpha intensity of the beam, color Maybe i'm totally wrong and WPF is not ready for that , so advise me about other way ( xna,d3D ) with sample of course ;-) Thanks you

    Read the article

  • Track "commands" send to WPF window by touchpad (Bamboo)

    - by Christian
    Hi, I just bought a touchpad wich allows drawing and using multitouch. The api is not supported fully by windows 7, so I have to rely on the build in config dialog. The basic features are working, so if I draw something in my WPF tool, and use both fingers to do a right click, I can e.g. change the color. What I want to do now is assign other functions to special features in WPF. Does anybody know how to find out in what way the pad communicates with the app? It works e.g. in Firefox to scroll, like it should (shown on this photo). But I do not know how to hookup the scroll event, I tried a Scrollviewer (which ignores my scroll attempts) and I also hooked up an event with the keypressed, but it does not fire (I assume the pad does not "press a key" but somehow sends the "scroll" command direclty. How can I catch that command in WPF? Thanks a lot, Chris [EDIT] I got the scroll to work, but only up and down, not left and right. It was just a stupid "listbox in scrollviewer" mistake. But still not sure about commands like ZOOM in (which is working even in paint).. Which API contains such things? [EDIT2] Funny, the zoom works in Firefox, the horizontal scrolling does not. But, in paint, the horizontal scrolling works... [EDIT 3] Just asked in the wacom forum, lets see about vendor support reaction time... http://forum.wacom.eu/viewtopic.php?f=4&t=1939 Here is a picture of the config surface to get the idea what I am talking about: (Bamboo settings, I try to catch these commands in WPF)

    Read the article

  • Vanilla WPF application hangs on one customer's machine

    - by Heinzi
    At a customer, one of our WPF applications started to hang. When trying to reproduce the problem with a minimal working example, I discovered that even the most basic (non-trivial) WPF application will hang on that machine. Example A: Create a new C# WPF project in Visual Studio 2008. Change nothing, compile it and run it on the customer's machine. It will run. Example B: Take Example A, and add a TextBlock to the main form Window1: <Window ...> <Grid> <TextBlock>Test</TextBlock> </Grid> </Window> Compile the application and run it on the customer's machine. It will hang: The title bar and the window border is visible, the inside is transparent and the window does not react to anything (cannot be moved or closed). The application must be shut down using the task manager. Obviously, this customer's WPF is broken. Is this a known issue, i.e., has anyone encountered it before and already knows how to solve it (e.g. reinstall .net 3.5 SP1, etc.)? The development machine is W7SP1, the customer's machine is XP (probably SP3, didn't check).

    Read the article

  • Does WPF break an Entity Framework ObjectContext?

    - by David Veeneman
    I am getting started with Entity Framework 4, and I am getting ready to write a WPF demo app to learn EF4 better. My LINQ queries return IQueryable<T>, and I know I can drop those into an ObservableCollection<T> with the following code: IQueryable<Foo> fooList = from f in Foo orderby f.Title select f; var observableFooList = new ObservableCollection<Foo>(fooList); At that point, I can set the appropriate property on my view model to the observable collection, and I will get WPF data binding between the view and the view model property. Here is my question: Do I break the ObjectContext when I move my foo list to the observable collection? Or put another way, assuming I am otherwise handling my ObjectContext properly, will EF4 properly update the model (and the database)? The reason why I ask is this: NHibernate tracks objects at the collection level. If I move an NHibernate IList<T> to an observable collection, it breaks NHibernate's change tracking mechanism. That means I have to do some very complicated object wrapping to get NHibernate to work with WPF. I am looking at EF4 as a way to dispense with all that. So, to get EF4 working with WPF, is it as simple as dropping my IQueryable<T> results into an ObservableCollection<T>. Does that preserve change-tracking on my EDM entity objects? Thanks for your help.

    Read the article

  • Windows 7 theme for WPF?

    - by DanM
    Is there any way to make a WPF app look like it's running on Windows 7 even if it's running on XP? I'm looking for some kind of theme I can just paste in. I'm aware of the themes project on Codeplex (http://www.codeplex.com/wpfthemes), but it lacks support for DataGrid, which is something I critically need. I was thinking maybe the Windows 7 theme would just be an easy port, or exists in some file somewhere already. Any information you have (even if it's bad news) would be much appreciated. Update Using @Lars Truijens idea, I was able to get the Windows 7 look for the major controls, but unfortunately it did not work for the WPF Toolkit DataGrid control, which I need. DataGrid looks like this with Aero theme DataGrid should look like this So, I'm still looking for a solution to this problem if anyone has any ideas. Maybe someone has built an extension to the Aero theme that covers the WPF toolkit controls? Again, any information you have is much appreciated. Update 2 - Problem solved! To get the Aero theme to work with WPF Toolkit controls, you just need to add a second Aero dictionary, so your App.xaml should now look like this. <Application.Resources> ... <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml" /> <ResourceDictionary Source="pack://application:,,,/WPFToolkit;component/Themes/Aero.NormalColor.xaml" /> ... </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> Also, I would recommend turning the gridlines off in your DataGrid controls (because they look horrible): <DataGrid GridLinesVisibility="None" ...>

    Read the article

  • Testing a Gui-heavy WPF application.

    - by Hamish Grubijan
    We (my colleagues) have a messy 12 y.o. mature app that is GUI-based, and the current plan is to add new dialogs & other GUI in WPF, as well as replace some of the older dialogs in WPF as well. At the same time we wish to be able to test that Monster - GUI automation in a maintainable way. Some challenges: The application is massive. It constantly gains new features. It is being changed around (bug fixes, patches). It has a back end, and a layer in-between. The state of it can get out of whack if you beat it to death. What we want is: Some tool that can automate testing of WPF. auto-discovery of what the inputs and the outputs of the dialog are. An old test should still work if you add a label that does nothing. It should fail, however, if you remove a necessary text field. It would be very nice if the test suite was easy to maintain, if it ran and did not break most of the time. Every new dialog should be created with testability in mind. At this point I do not know exactly what I want, so I am marking this as a community wiki. If having to test a huge GUI-based app rings the bell (even if not in WPF), then please share your good, bad and ugly experiences here.

    Read the article

  • Where is the Open Source alternative to WPF?

    - by Evan Plaice
    If we've learned anything from HTML/CSS it's that, declarative languages (like XML) work best to describe User Interfaces because: It's easy to build code preprocessors that can template the code effectively. The code is in a well defined well structured (ideally) format so it's easy to parse. The technology to effectively parse or crawl an XML based source file already exists. The UIs scripted code becomes much simpler and easier to understand. It simple enough that designers are able to design the interface themselves. Programmers suck at creating UIs so it should be made easy enough for designers. I recently took a look at the meat of a WPF application (ie. the XAML) and it looks surprisingly familiar to the declarative language style used in HTML. It's blindingly apparent to me that the current state of desktop UI development is largely fractionalized, otherwise there wouldn't be so much duplicated effort in the domain of user interfaces (IE. GTK, XUL, Qt, Winforms, WPF, etc). There are 45 GUI platforms for Python alone It's painfully obvious to me that there should be a general purpose, open source, standardized, platform independent, markup language for designing desktop GUIs. Much like what the W3C made HTML/CSS into. WPF, or more specifically XAML seems like a pretty likely step in the right direction. Why hasn't anyone in the Open Source community (AFAIK) even scratched the surface of this issue. Now that the 'browser wars' are over should we look forward to a future of 'desktop gui wars?' Note: This topic is relatively subjective in the attempt to be 'future-thinking.' I think that desktop GUI development in its current state sucks ((really)hard) and, even though WPF is still in it's infancy, it presents a likely solution to the problem. Has no one in the OS community looked into developing something similar because they don't see the value, or because it's not worth the effort?

    Read the article

  • Creating WPF components in background thread

    - by mizipzor
    Im working on a reporting system, a series of DocumentPage are to be created through a DocumentPaginator. These documents include a number of WPF components that are to be instantiated so the paginator includes the correct things when later sent to the XpsDocumentWriter (which in turn is sent to the actual printer). My problem now is that the DocumentPage instances take quite a while to create (enough for Windows to mark the application as frozen) so I tried to create them in a background thread, which is problematic since WPF expects the attributes on them to be set from the GUI thread. I would also like to have a progress bar showing up, indicating how many pages have been created so far. Thus, it looks like Im trying to get two things to happen in parallell on the GUI. The problem is hard to explain and Im really not sure how to tackle it. In short: Create a series of DocumentPage's. These include WPF components These are to be created on a background thread, or use some other trick so the application isnt frozen. After each page is created, a WPF ProgressBar should be updated. If there is no decent way to do this, alternate solutions and approaches are more than welcome.

    Read the article

  • WPF - Transparency - Stream Desktop Content

    - by Niels Willems
    Greetings I'm in the process of making a Scoreboard for a game (Starcraft II). This scoreboard is being made as a WPF Application with a C# code-behind. I already have a version which works for 90% in WinForms but I lacked the support to easily make it look a lot nicer which are available in WPF. The point of this application will be to form a kind of overlay on top of a running game. This game is in Fulscreen(Windowed Mode) so when in WinForms I coded it so that it should always be on top. It would do so and that was no problem. Since the main look of the app in WPF is based on an image with a transparent background I have set most Background values to Transparent. However when I do this the entire application does not get registered by streaming software. For example it just shows my Desktop or the game I'm playing but not my application even though it IS there. I can see it with my own eyes but the audience on the stream cannot. Does anyone have any experience with this matter because it's really doing my head in. My entire application will be useless if it is not visible on streams. If I have to put the background on a color rather than transparent the UI will be completely demolished as well in terms of looks. I'm basically trying to make a game-overlay in C# & WPF. I have read you can do this on different ways as well but I have little to no knowledge of C++ nor do I know anything about DirectX Thank you for your time reading and your possible insights. Edit: The best solution would be an overlay similar to that one of Steam/Xfire/Dolby Axon. Edit 2: I've had no luck with all the suggestions so I basically made the transparent bits of my image non transparent and let the user decide which one to use depending on what streaming software they would be using.

    Read the article

  • [C#] Dynamic user-interface, WPF or not?

    - by pieter.lowie
    Hi, I'm currently working at a application that helps people understand how to do there job. You can see it as a personal coach that guides them trough all the steps they need to do that no normal person could keep remembering. In my previous application we had the ability to show the user up to 4 pictures (what proves to be more then enough). The application would load the data and see how many pictures where in every instruction and then sort out the picture in the best fitting way without messing up the scale and resolution of the pictures. This all was done with GDI+ and worked very well. Ofc, change is something that always happens, my bosses came up with some great ideas. So they want to be able to see movies on the screen, animated gif's, 3D models that can rotate or animate. So I think we had pushed GDI+ to it's limits and it's time to look for something different. I have heard and readed about WPF but have no experience with it. Is it even possible to do all what I ask in WPF? And what about the old picture-merging thing I wrote, can we also get it done in wpf? I tried to make some things working but I didn't went as smooth as I hoped. I'm also concerned about the fact that the interface needs to be dynamic, the one moment it should be showing picture with some text above it, the other moment it should be showing another text with a video under it. I would love to hear some opinions here and if you got some other suggestions I should look into pls tell me. Thnx in advance PS: If WPF is the choice, should I convince my boss to change to .net 4.0?

    Read the article

  • Force validation on bound controls in WPF

    - by Valentin Vasilyev
    Hello. I have a WPF dialog with a couple of textboxes on it. Textboxes are bound to my business object and have WPF validation rules attached. The problem is that user can perfectly click 'OK' button and close the dialog, without actually entering the data into textboxes. Validation rules never fire, since user didn't even attempt entering the information into textboxes. Is it possible to force validation checks and determine if some validation rules are broken? I would be able to do it when user tries to close the dialog and prohibit him from doing it if any validation rules are broken. Thank you.

    Read the article

  • Dynamic controls lost when postback

    - by Joren
    Hi I load my self-made webuser controls dynamically. A user chooses a template and depending on that template I load some self-made webuser controls (.ascx) that are defined in a sql server database. When the user fills in the TextBoxes and clicks on the submit button, the entries in the TextBoxes should be saved in my database. The problem is that when clicking the submit button, the TextBox entries are erased. I searched a lot to fix this problem, for example I tried to load every control again every postback by putting the code in the Page_Init event but unfortunately it won't work.

    Read the article

  • Formatting Controls in ASP.NET

    - by Brian
    I feel as though this this is a simple question, but can't find an answer anywhere. We've got an interface we're trying to move to an ASP.NET control. It currently looks like: <link rel=""stylesheet"" type=""text/css"" href=""/Layout/CaptchaLayout.css"" /> <script type=""text/javascript"" src=""../../Scripts/vcaptcha_control.js""></script> <div id="captcha_background"> <div id="captcha_loading_area"> <img id="captcha" src="#" alt="" /> </div> <div id="vcaptcha_entry_container"> <input id="captcha_answer" type="text"/> <input id="captcha_challenge" type="hidden"/> <input id="captcha_publickey" type="hidden"/> <input id="captcha_host" type="hidden"/> </div> <div id="captcha_logo_container"></div> </div> However all the examples I see of ASP.NET controls that allow for basical functionality - i.e. public class MyControl : Panel { public MyControl() { } protected override void OnInit(EventArgs e) { ScriptManager.RegisterScript( ... Google script, CSS, etc. ... ); TextBox txt = new TextBox(); txt.ID = "text1"; this.Controls.Add(txt); CustomValidator vld = new CustomValidator(); vld.ControlToValidate = "text1"; vld.ID = "validator1"; this.Controls.Add(vld); } } Don't allow for the detailed layout that we need. Any suggestions on how I can combine layout and functionality and still have a single ASP control we can drop in to pages? The ultimate goal is for users of the control to just drop in: <captcha:CaptchaControl ID="CaptchaControl1" runat="server" Server="http://localhost:51947/" /> and see the working control. Sorry for the basic nature of this one, any help is greatly appreciated.

    Read the article

  • Adding dynamic controls to Silverlight application after WCF Service Asynchronous Callback

    - by Birk
    I'm trying to add some dynamic controls to my Silverlight page after a WCF call. When I try to add a control to I get an error: Object reference not set to an instance of an object. Here is a simplified version of my code: using edm = SilverlightBusinessApplication.ServiceRefrence; public partial class ListWCF : Page { edm.ServiceClient EdmClient = new ServiceClient(); public ListWCF() { EdmClient.GetTestCompleted += EdmGetTestCompleted; EdmClient.GetTestAsync(); } private void EdmGetTestCompleted(object sender, edm.GetTestCompletedEventArgs e) { //This is where I want to add my controls Button b = new Button(); LayoutRoot.Children.Add(b); //Error: Object reference not set to an instance of an object } } Is it not possible to modify the page after it has been loaded? What am I missing? Thanks

    Read the article

  • Visual Studio massive renaming of controls in WPF project

    - by Mark
    I have a scene in my WPF project with about 2000 different user controls: <local:MyControlType x:name="aaka4sn9f" /> <local:MyControlType x:name="aaks22nf_1" /> <local:MyControlType x:name="aa66s2f_2" /> and so on down the screen... Is there a way to rename all of these controls using Visual Studio (and possibly a regex) to be: <local:MyControlType x:name="myControl1" /> <local:MyControlType x:name="myControl2" /> <local:MyControlType x:name="myControl3" /> ?? Thanks a lot!

    Read the article

  • How do I layout a form in WPF using grid or other controls for maintainability

    - by Jason Coyne
    I have a WPF form, I want to lay out a standard form onto it. Each form element will have a label, and then a control. Pretty standard stuff. If I use a wrap panel, it can cause the label and the control to be separated, but I want them to stay together. is there some WPF equivalent of nobr? Grid works, and allows for column spanning etc, however I really really hate that you specify the column and row on each control. This makes it extremely inconvenient to reorder or insert things into the list. Is there a way to get the grid to use more HTML style column/rows where the items are a child of the row they are in, so that I can re-order easily? Is there some other control that will let me layout a form easily?

    Read the article

  • Bindable richTextBox still hanging in memory {WPF, Caliburn.Micro}

    - by Paul
    Hi, I use in WFP Caliburn.Micro Framework. I need bindable richTextbox for Document property. I found many ways how do it bindable richTextBox. But I have one problem. From parent window I open child window. Child window consist bindable richTextBox user control. After I close child window and use memory profiler view class with bindabelrichTextBox control and view model class is still hanging in memory. - this cause memory leaks. If I use richTextBox from .NET Framework or richTextBox from Extended WPF Toolkit it doesn’t cause this memory leak problem. I can’t identified problem in bindable richTextBox class. Here is ist class for bindable richTextBox: Base class can be from .NET or Extended toolkit. /// <summary> /// Represents a bindable rich editing control which operates on System.Windows.Documents.FlowDocument /// objects. /// </summary> public class BindableRichTextBox : RichTextBox { /// <summary> /// Identifies the <see cref="Document"/> dependency property. /// </summary> public static readonly DependencyProperty DocumentProperty = DependencyProperty.Register("Document", typeof(FlowDocument), typeof(BindableRichTextBox)); /// <summary> /// Initializes a new instance of the <see cref="BindableRichTextBox"/> class. /// </summary> public BindableRichTextBox() : base() { } /// <summary> /// Initializes a new instance of the <see cref="BindableRichTextBox"/> class. /// </summary> /// <param title="document">A <see cref="T:System.Windows.Documents.FlowDocument"></see> to be added as the initial contents of the new <see cref="T:System.Windows.Controls.BindableRichTextBox"></see>.</param> public BindableRichTextBox(FlowDocument document) : base(document) { } /// <summary> /// Raises the <see cref="E:System.Windows.FrameworkElement.Initialized"></see> event. This method is invoked whenever <see cref="P:System.Windows.FrameworkElement.IsInitialized"></see> is set to true internally. /// </summary> /// <param title="e">The <see cref="T:System.Windows.RoutedEventArgs"></see> that contains the event data.</param> protected override void OnInitialized(EventArgs e) { // Hook up to get notified when DocumentProperty changes. DependencyPropertyDescriptor descriptor = DependencyPropertyDescriptor.FromProperty(DocumentProperty, typeof(BindableRichTextBox)); descriptor.AddValueChanged(this, delegate { // If the underlying value of the dependency property changes, // update the underlying document, also. base.Document = (FlowDocument)GetValue(DocumentProperty); }); // By default, we support updates to the source when focus is lost (or, if the LostFocus // trigger is specified explicity. We don't support the PropertyChanged trigger right now. this.LostFocus += new RoutedEventHandler(BindableRichTextBox_LostFocus); base.OnInitialized(e); } /// <summary> /// Handles the LostFocus event of the BindableRichTextBox control. /// </summary> /// <param title="sender">The source of the event.</param> /// <param title="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param> void BindableRichTextBox_LostFocus(object sender, RoutedEventArgs e) { // If we have a binding that is set for LostFocus or Default (which we are specifying as default) // then update the source. Binding binding = BindingOperations.GetBinding(this, DocumentProperty); if (binding.UpdateSourceTrigger == UpdateSourceTrigger.Default || binding.UpdateSourceTrigger == UpdateSourceTrigger.LostFocus) { BindingOperations.GetBindingExpression(this, DocumentProperty).UpdateSource(); } } /// <summary> /// Gets or sets the <see cref="T:System.Windows.Documents.FlowDocument"></see> that represents the contents of the <see cref="T:System.Windows.Controls.BindableRichTextBox"></see>. /// </summary> /// <value></value> /// <returns>A <see cref="T:System.Windows.Documents.FlowDocument"></see> object that represents the contents of the <see cref="T:System.Windows.Controls.BindableRichTextBox"></see>.By default, this property is set to an empty <see cref="T:System.Windows.Documents.FlowDocument"></see>. Specifically, the empty <see cref="T:System.Windows.Documents.FlowDocument"></see> contains a single <see cref="T:System.Windows.Documents.Paragraph"></see>, which contains a single <see cref="T:System.Windows.Documents.Run"></see> which contains no text.</returns> /// <exception cref="T:System.ArgumentException">Raised if an attempt is made to set this property to a <see cref="T:System.Windows.Documents.FlowDocument"></see> that represents the contents of another <see cref="T:System.Windows.Controls.RichTextBox"></see>.</exception> /// <exception cref="T:System.ArgumentNullException">Raised if an attempt is made to set this property to null.</exception> /// <exception cref="T:System.InvalidOperationException">Raised if this property is set while a change block has been activated.</exception> public new FlowDocument Document { get { return (FlowDocument)GetValue(DocumentProperty); } set { SetValue(DocumentProperty, value); } } } Thank fro help and advice. Qucik example: Child window with .NET richTextBox <Window x:Class="WpfApplication2.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"> <Grid> <RichTextBox Background="Green" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" FontSize="13" Margin="4,4,4,4" Grid.Row="0"/> </Grid> </Window> This window I open from parent window: var w = new Window1(); w.Show(); Then close this window, check with memory profiler and it memory doesn’t exist any object of window1 - richTextBox. It’s Ok. But then I try bindable richTextBox: Child window 2: <Window x:Class="WpfApplication2.Window2" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Controls="clr-namespace:WpfApplication2.Controls" Title="Window2" Height="300" Width="300"> <Grid> <Controls:BindableRichTextBox Background="Red" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" FontSize="13" Margin="4,4,4,4" Grid.Row="0" /> </Grid> </Window> Open child window 2, close this child window and in memory are still alive object of this child window also bindable richTextBox object.

    Read the article

  • APress Deal of the Day 23/May/2014 - Pro WPF 4.5 in C#

    - by TATWORTH
    Originally posted on: http://geekswithblogs.net/TATWORTH/archive/2014/05/23/apress-deal-of-the-day-23may2014---pro-wpf-4.5.aspxToday’s $10 Deal of the Day from APress at http://www.apress.com/9781430243656 is Pro WPF 4.5 in C#. “This book shows you how Windows Presentation Foundation really works. It provides you with the no-nonsense, practical advice that you need in order to build high-quality WPF applications quickly and easily. Pro WPF 4.5 in C# provides a thorough, authoritative guide to how WPF really works. Packed with no-nonsense examples and practical advice you'll learn everything you need to know in order to use WPF in a professional setting. The book begins by building a firm foundation of elementary concepts, using your existing C# skills as a frame of reference, before moving on to discuss advanced concepts and demonstrate them in a hands-on way that emphasizes the time and effort savings that can be gained.”

    Read the article

  • APress Deal of the Day - 13/Apr/2012 - Pro WPF and Silverlight MVVM

    - by TATWORTH
    The APress $10 deal of the day for today is "Applied WPF 4 in Context" (http://www.apress.com/9781430234708) starts with a simple introduction to WPF and then shows a complete WPF application from sketch to completed code. This APress web site states "This book can be used by a junior developer to learn WPF and understand how to architect a layered application, and it can also be used by a senior developer as a reference for developing scalable WPF applications. " - this summerises the book very effectively as it is indeed an excellent book both for learning WPF and as a reference for development. I recommend it to all Dot Net development teams.

    Read the article

  • WPF Toolkit DataGrid SelectionChanged Getting Cell Value

    - by Dan Bater
    Hi, Please help me, Im trying to get the value of Cell[0] from the selected row in a SelectionChangedEvent. I am only managing to get lots of different Microsoft.Windows.Controls and am hoping im missing something daft. Hoping I can get some help from here... private void datagrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { Microsoft.Windows.Controls.DataGrid _DataGrid = sender as Microsoft.Windows.Controls.DataGrid; } I was hoping it would be something like... _DataGrid.SelectedCells[0].Value; However .Value isn't an option.... Many many thanks this has been driving me mad! Dan

    Read the article

  • Non-resizeable, bordered WPF Windows with WindowStyle=None

    - by danielmartinoli
    Basically, I need a window to look like the following image: http://screenshots.thex9.net/2010-05-31_2132.png (Is NOT resizeable, yet retains the glass border) I've managed to get it working with Windows Forms, but I need to be using WPF. To get it working in Windows Forms, I used the following code: protected override void WndProc(ref Message m) { if (m.Msg == 0x84 /* WM_NCHITTEST */) { m.Result = (IntPtr)1; return; } base.WndProc(ref m); } This does exactly what I want it to, but I can't find a WPF-equivalent. The closest I've managed to get with WPF caused the Window to ignore any mouse input. Any help would be hugely appreciated :)

    Read the article

  • Sharing WPF RichTextBox content with Silverlight RichTextBox

    - by Stewart Armbrecht
    Has anyone figured out the best way to persist a WPF and Silverlight RichTextBox content so that it can be shared between the two? I haven't had the time to test through this so I wanted to see if anyone else has. I currently have a WPF applicaiton that saves the content of a RichTextBox as a blob in the database using the following code: byte[] result = null; TextRange range = new TextRange(flowDocument.ContentStart, flowDocument.ContentEnd); if (range.IsEmpty == false) { using (MemoryStream strm = new MemoryStream()) { range.Save(strm, DataFormats.XamlPackage, true); result = strm.ToArray(); strm.Close(); } } return result; I am building a silverlight version of the application and want to know how I can load (and save) this content using the Silverlight RichTextBox so that it can still be using in the WPF application.

    Read the article

  • Using MS ReportViewer in WPF

    - by Mitch
    I'm about to start using the MS ReportViewer in a WPF application by placing the ReportViewer in a WindowsFormsHost. Is this the correct approach? What is the best way of designing the reports as you cannot use the ReportViewer at design time in a WindowsFormsHost. Is it best to create an RDL report in SQL Server and then convert it to an RDLC or maybe to create a new Winforms app to create an RDLC file in a WinForms framework and then copy it to the WPF app. I will need to filter the reports via dropdowns so there's that aspect to consider too. If anyone out there is already using ReportViewer in WPF I would appreciate some feedback on the best approach.....Many thanks.

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >