WPF issues

Can Microsoft WPF team make WPF more user/developer friendly?
Is it possible that WPF ListView has the capability to access column (grid) of the List? I mean accessing the column cell while the cell is clicked by mouse. It seems not able to do so at this moment.
Is it possible that whatever WPF control has the capability to allow developer to design the interface easier? for example, a developer can specify the elements of a control, then WPF can generate the codes and XAML for the developer? To be more epecific,
can a developer design a ListView, and assign each column of the Listview attributes, then WPF generates the WAML and code behind for the ListView designed? Developer then can modify the code behind for additional functions. I think this can be done better.
For simple text column, it's been done. But, for complex column such as image/picture objects, it's not done yet. Developer should be able to specify the (dynamic) data source for the image/picture column, then it's done. This is the area where Microsoft can
improve and should have improved quite a bit.

Is it possible that WPF ListView has the capability to access column (grid) of the List? I mean accessing the column cell while the cell is clicked by mouse. It seems not able to do so at this moment.
You can work out which cell is clicked.
There's a routed event you could handle and work it out.
Often that isn't the ideal way to do things though.
For example a tooltip can be bound to the same context a cell is in and you can "do stuff" inside that with a button or whatever.
I think from the rest of your questions you basically want a completely different set of tooling.
Whilst all those things might be possible I think MS current focus is more on developing windows app store than WPF and there is a relatively small WPF team.
That leads me to think that big changes are highly unlikely.
I doubt you'll get any sort of official answer.
Hope that helps.
Recent Technet articles:
Property List Editing;  
Dynamic XAML

Similar Messages

  • WPF ElementHost Canvas, MouseDown event

    Hi,
    This is to get the ElementHost MouseDown event to fire, a canvas was manually added as a child to the element host, when its opacity was changed to 95%. Still neither of the events independently set for the element host and the canvas fire.
    I have not changed the canvas background property yet. I am not sure where to find the proper documentations for such events, nor of how the mouse down event mechanism behavior is, specially in this case that the entire element host container
    area is covered by the WPF controls, any insight is greatly appreciated.
    Best Regards,
    AliReza Bemanian, Ph.D.

    Hi AliReza Bemanian,
    Since it is the WPF issue, I help you move this case to the Windows Presentation Foundation (WPF) forum for dedicated support.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Main window buried when launched

    The program launches, the menu appears at the top, but if there are any other program windows open, the main Inbox window hides behind them. I have to click on the Mail icon in the dock to bring it forward.
    I know it's not a major problem, but it never did that before.
    Permissions repaired and disk verified OK. Any thoughts?

    I can reproduce your issue. The MainWindow gets deactivated. This happens when one windows owns a second, which in turn owns a third window and is actually not a WPF issue but a Win32 one:
    http://stackoverflow.com/questions/3144004/wpf-app-loses-completely-focus-on-window-close
    The easiest work around in your case is to not set the Owner property of the SettingsWindow in the settings_btn_Click event handler in MainWindow:
    private void settings_btn_Click(object sender, RoutedEventArgs e)
    //REMOVE THIS LINE: settings.Owner = this;
    if (!settings.IsVisible)
    settings.Show();
    else
    settings.Activate();
    For all child windows to still get closed as expected when you close the MainWindow you can then set the Shutdown mode property of the application to OnMainWindowClose in your App.xaml:
    <Application x:Class="InformationAlt.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    StartupUri="MainWindow.xaml" ShutdownMode="OnMainWindowClose">
    <Application.Resources>
    </Application.Resources>
    </Application>
    Hope that helps.
    Please remember to close your threads by marking helpful posts as answer and please start a new thread if you have a new question.

  • Merge Word and PDF to Single PDF via C#

    Hi,
    This sounds like a relatively simple operation and yet I have been unable to find a good code sample that can get this done programattically. I would like to avoid using anything other than the free SDK from Adobe. Basically I just want to take a word document and a PDF document and produce 1 PDF document. Can I do this via the menus in Acrobat - YES, but I need to do it via code in a single step without user interaction. This will be a straightforward client side only app. Can anyone help me here and I apologize in advance is this is too simple.
    Thanks,
    John

    Hi SuneelKumar.
    This forum is to discuss problems of C# development. Your question is not related to the topic of this forum.
    For Asp.net issue
    You'll need to post it in the dedicated ASP.Net Forum
    http://forums.asp.net
    for more efficient responses, where you can contact ASP.NET experts.
    For WPF issue
    You'll need to post it .NET Framework  > Windows Presentation Foundation (WPF)
    Have a nice day!
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Issue with worksheet.Select(true) after hosting Excel window in WPF application

    The issue is with Office 2013.
    We are hosting excel workbook window in WPF application using HwndHost class. In overridden BuildWindowCore method of HwndHost class, we are creating a MDICLIENT Window and setting this MDICLIENT window handle as parent for Excel
    main window handle and returning HandleRef object of MDICLIENT window handle from BuildWindowCore method.
    Once HwndHost control is loaded, we are selecting sheet of excel in the loaded event of HwndHost control. The code for selection of sheet is given below.
    dynamic workSheet =
    this.excelApplication.Workbooks[1].Worksheets[sheetName];
    this.excelApplication.Workbooks[1].Activate()
    workSheet.Activate();
    workSheet.Select(true);
    The first time execution of
    workSheet.Select(true)
    halt for few seconds and then it throws exception “System.Runtime.InteropServices.ComException”
    with message “The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))”.
    But it executes successfully without delay on subsequent calls. Sometimes the execution halt for minutes on different Systems.
    This absurd behaviour is seen only once in application instance life time and that too after excel window gets loaded in WPF application. If we execute
    workSheet.Select(true)
    before loading of window then it executes properly. Once
    workSheet.Select(true)
    executed for first time with exception, it executes successfully without delay on subsequent calls.

    No, I dont have any macro in the sheet and it is happpening with all workbooks. The problem is consistent with all workbooks and also it throws exception only for first time in the application. If I execute it again in same application instance, it works
    properly.

  • Issue working with WPF client v6.1.0.3 for SAP Service Manager 4.0

    Hi All,
    This issue is similar to an on - going discussion -  http://scn.sap.com/thread/3508608
    Issue Description :
    1. We installed WPF client 6.1.03 for SAP Service Manager 4.0 using SMP 2.3 SP00. We got the below error
    2.  To solve this error we followed the forum - http://scn.sap.com/thread/3465106 and installed the certificate following the link for installing the self signed certificate from Sybase infocenter.
    3. We came to know that this is due to the SMP version. hence as suggested by SAP we upgraded the server to SMP 2.3 SP03
    4. We tried to connect the WPF client and again got the error "Communication error 14"
    My Question is
    1. After the server upgrade from SP2.3 SP03 , do I still need to generate a certificate again ? Is yes Please guide me the steps/document to do this step
    2. Is there any document which mentions how exactly we use the WPF client, the configuration  to connect the SAP backend and download the Syclo Service Manager 4.0 application without any issue
    Please guide
    Thanks
    Neha

    HI Steve,
    I tested with the WPF client 6.1.3.X.
    I was getting a different error with the host name "Connect to server  myhostname certificate is for myhostname:domain name this is not valid. Commnication error(14)
    However I got the solution in one of the link where they mention to provide the complete fully qualified domain name in the server ie myhostname:domain .
    This has solved the issue and the WPF client is up and running.
    Thanks for the help
    Regards
    Neha Mahanty

  • Debugging issue with WPF

    Hello,
      I am trying to debug some of my code for a set of WPF buttons.   I am stuck with an issue that I cannot get around.  When I launch the debugger from Visual Studio 2013, I get the following in the web browser:
    An error occurred in the application you were using
    You can try the following:
    Restart the application.
    Click the "More Information" link below for
    details about this error.
    Less Information
    <textarea cols="1" id="errorInfo" readonly="readonly" rows="1" style="width:752px;height:650px;display:block;" wrap="off">Startup URI: \\mrm2inc.com\Users\Michael.Mastro2\Documents\Visual
    Studio 2013\Projects\HomeInventoryWebForms\HomeInventoryWebForms\bin\Debug\HomeInventoryWebForms.xbap Application Identity: file://mrm2inc.com/Users/Michael.Mastro2/Documents/Visual%20Studio%202013/Projects/HomeInventoryWebForms/HomeInventoryWebForms/bin/Debug/HomeInventoryWebForms.xbap#HomeInventoryWebForms.xbap,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=fc075058c6cf26e0, processorArchitecture=msil/HomeInventoryWebForms.exe, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fc075058c6cf26e0, processorArchitecture=msil, type=win32 System.Security.Policy.PolicyException:
    Execution permission cannot be acquired. at System.Runtime.Hosting.ApplicationActivator.CreateInstanceHelper(AppDomainSetup adSetup) at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
    at System.Windows.Interop.PresentationApplicationActivator.CreateInstance(ActivationContext actCtx) at System.Activator.CreateInstance(ActivationContext activationContext) at System.Windows.Interop.ApplicationLauncherXappDebug.Initialize() at System.Windows.Interop.DocObjHost.MS.Internal.AppModel.IBrowserHostServices.Run(String
    path, String fragment, MimeType mime, String debugSecurityZoneURL, String applicationId, Object streamContainer, Object ucomLoadIStream, HostingFlags hostingFlags, INativeProgressPage nativeProgressPage, String progressAssemblyName, String progressClassName,
    String errorAssemblyName, String errorClassName, IHostBrowser hostBrowser) ----------------------- PresentationHost.exe v4.0.41210.0 built by: Main - C:\Windows\SysWOW64\PresentationHost.exe ntdll.dll v6.3.9600.17031 (winblue_gdr.140221-1952) - C:\Windows\SYSTEM32\ntdll.dll
    KERNEL32.DLL v6.3.9600.17031 (winblue_gdr.140221-1952) - C:\Windows\SYSTEM32\KERNEL32.DLL KERNELBASE.dll v6.3.9600.17031 (winblue_gdr.140221-1952) - C:\Windows\SYSTEM32\KERNELBASE.dll ADVAPI32.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\ADVAPI32.dll
    USER32.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\USER32.dll msvcrt.dll v7.0.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\msvcrt.dll ole32.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\ole32.dll OLEAUT32.dll
    v6.3.9600.17415 - C:\Windows\SYSTEM32\OLEAUT32.dll mscoree.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\mscoree.dll SHLWAPI.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\SHLWAPI.dll WININET.dll v11.00.9600.16384
    (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\WININET.dll urlmon.dll v11.00.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\urlmon.dll SHELL32.dll v6.3.9600.17031 (winblue_gdr.140221-1952) - C:\Windows\SYSTEM32\SHELL32.dll sechost.dll v6.3.9600.16384
    (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\sechost.dll RPCRT4.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\RPCRT4.dll GDI32.dll v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\GDI32.dll combase.dll v6.3.9600.16384
    (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\combase.dll iertutil.dll v11.00.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\iertutil.dll USERENV.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\USERENV.dll SspiCli.dll v6.3.9600.17415
    (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\SspiCli.dll profapi.dll v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\profapi.dll CRYPTBASE.dll v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\CRYPTBASE.dll bcryptPrimitives.dll
    v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\bcryptPrimitives.dll IMM32.DLL v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\system32\IMM32.DLL MSCTF.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\MSCTF.dll shcore.dll
    v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\shcore.dll PresentationHost_v0400.dll v4.0.30319.33440 built by: FX45W81RTMREL - C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\PresentationHost_v0400.dll MSVCR120_CLR0400.dll v12.00.51670.34230
    built by: FX452RTMGDR - C:\Windows\SYSTEM32\MSVCR120_CLR0400.dll VERSION.dll v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\VERSION.dll PSAPI.DLL v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\PSAPI.DLL kernel.appcore.dll v6.3.9600.17415
    (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\kernel.appcore.dll uxtheme.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\system32\uxtheme.dll ltc_help32-91954.dll v1, 0, 0, 1 - C:\PROGRA~2\Raptr\ltc_help32-91954.dll WINTRUST.dll v6.3.9600.17415
    (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\WINTRUST.dll CRYPT32.dll v6.3.9600.16431 (winblue_gdr.131015-2301) - C:\Windows\SYSTEM32\CRYPT32.dll MSASN1.dll v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\MSASN1.dll clbcatq.dll v2001.12.10530.17415
    (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\clbcatq.dll CRYPTSP.dll v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\CRYPTSP.dll rsaenh.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\system32\rsaenh.dll bcrypt.dll v6.3.9600.16384
    (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\bcrypt.dll ieproxy.dll v11.00.9600.17496 (winblue_r5.141121-1500) - C:\Program Files (x86)\Internet Explorer\ieproxy.dll PROPSYS.dll v7.00.9600.17031 (winblue_gdr.140221-1952) - C:\Windows\SYSTEM32\PROPSYS.dll
    dfshim.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\dfshim.dll mscoreei.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll clr.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
    Secur32.dll v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\Secur32.dll dwmapi.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\system32\dwmapi.dll msxml3.dll v8.110.9600.17415 - C:\Windows\System32\msxml3.dll actxprxy.dll v6.3.9600.17416
    (winblue_r4.141030-1500) - C:\Windows\SYSTEM32\actxprxy.dll sxs.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\sxs.dll PresentationHostProxy.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\PresentationHostProxy.dll
    comctl32.dll v6.10 (winblue_rtm.130821-1623) - C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.17415_none_a9ed7f470139b3c1\comctl32.dll mscorlib.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\d03a3ddcd6a395878751c5e90fa16915\mscorlib.ni.dll
    System.ni.dll v4.0.30319.34239 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System\1a6b5095c4416a37f9ca4cf4436d1311\System.ni.dll WindowsBase.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\WindowsBase\bb26d987467eca70ebc4beec29158d67\WindowsBase.ni.dll
    PresentationCore.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\PresentationCore\24f6c80242420a1cea5cc254bf420027\PresentationCore.ni.dll PresentationFramework.ni.dll v4.0.30319.34209 - C:\Windows\assembly\NativeImages_v4.0.30319_32\Presentatio5ae0f00f#\4136b9a7a05c8f0e2c7e15600bc20b1b\PresentationFramework.ni.dll
    dwrite.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\dwrite.dll wpfgfx_v0400.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\wpfgfx_v0400.dll PresentationNative_v0400.dll v4.0.30319.33440
    built by: FX45W81RTMREL - C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\PresentationNative_v0400.dll System.Xaml.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Xaml\d626184834dde3f4906aff139d4e5bbf\System.Xaml.ni.dll
    clrjit.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\Microsoft.NET\Framework\v4.0.30319\clrjit.dll System.Xml.ni.dll v4.0.30319.34230 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Xml\9a349fb029581f4752d2c6cfcfeab816\System.Xml.ni.dll
    System.Drawing.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Drawing\d91798a9a9fcb450351fe8e49026a69f\System.Drawing.ni.dll System.Windows.Forms.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Windows.Forms\a4d2243df4af8ab65ff74d436d449789\System.Windows.Forms.ni.dll
    System.Security.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Security\d72f65a6622be86134ba8c534acc10e5\System.Security.ni.dll System.Core.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Core\794a3d83e77a53d6fc029c389f9cc408\System.Core.ni.dll
    System.Deployment.ni.dll v4.0.30319.34243 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Deployment\84fa9fa9c4be29612f8d268246a0353c\System.Deployment.ni.dll System.Configuration.ni.dll v4.0.30319.34209 built by: FX452RTMGDR
    - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Configuration\b5b80f1284dfa1b883da48ed58ecbc47\System.Configuration.ni.dll gpapi.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\gpapi.dll ncrypt.dll v6.3.9600.16384 (winblue_rtm.130821-1623)
    - C:\Windows\SYSTEM32\ncrypt.dll NTASN1.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\NTASN1.dll diasymreader.dll v12.0.20806.33440 built by: FX45W81RTMREL - C:\Windows\Microsoft.NET\Framework\v4.0.30319\diasymreader.dll uiautomationcore.dll
    v7.2.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\System32\uiautomationcore.dll </textarea>
    Anyone have any ideas how to get around this issue, or fix the issue?
    Michael R. Mastro II

    You need to be able to debug your code.
    This is a key ability.
    So key that this is the first thing you should be thinking about with any development ( which isn't trivial. ).
    Work out how to debug your application.
    Stick break points in there and explore what is going on.
    https://nirajrules.wordpress.com/2008/06/11/debugging-an-xbap-wcf-application-%E2%80%93-windows-vista-vsnet-2008/
    Hope that helps.
    Recent Technet articles:
    Property List Editing ;  
    Dynamic XAML

  • Group Tree issue when refreshing- Crystal for Visual Studio 2010 WPF Viewer

    Hello,
    We've run into an issue when refreshing reports with the WPF viewer for Visual Studio 2010. After the report is refreshed, the Group Tree is blank and it should have values. For example, you run a report and see values in the Group Tree. If you refresh the report with the same parameter values the Group Tree is blank.
    Has anyone run into this yet?
    Thanks,
    Tyler

    That is correct.
    I just did a quick test and was not able to reproduce the issue.
    Details of test:
    1) Create a new app;
    File | New | Project
    Visual Basic | reporting -> Crystal Reports WPF Application
    2) Add the "Open File" button to the viewer (ShowOpenFileButton off of the WPF viewer properties)
    3) Run app
    4) Browse to a report that has a number of groups >250
    5) Refresh report using the Refresh button on the viewer
    I'll work on this a bit later today, see if I can repro it another way. Meanwhile, can you provide mode details (code) on how you repro the issue?
    - Ludek

  • Thread issues in WPF

    Hi all,
    I have created a WPF application. It has mainpage.xaml file, I have created a user control and added this user control in a stackpanel in mainpage.xaml file. I user control file I have used backgroundworker and created dowork event due to this it creates
    a new thread and run it in the backgroud. Now I want to update the control defined in mainpage.xaml from user control file.
    How can I access the controls defined in mainpage.xaml file from user control file. I have used dispatcher for this. its working fine but just for immediate parent thread not the thread from which all others threads are created.
    Example:-
    A thread (Main UI thread)-->B thread -->C thread.
    Now I want to access the controls defined in 'A' thread from 'C' Thread.
    Please help me this.

    There are two issues here.
    1)
    You're on a different thread and controls have thread affinity.
    Controls are created on the UI thread.
    That means you can't change properties on them without using dispatcher.begininvoke to get onto the UI thread.
    2)
    Your thread was started up in this other usercontrol.
    That's a complication because encapsulation means that usercontrol shouldn't rely on knowing anything about that parent page.
    Kind of the idea of usercontrols is they are re-usable as well.
    So you don't really want to rely on that particular MainPage being the parent.  You might want to use your usercontrol elsewhere in Window1.xaml or something.
    MainPage.xaml is presumably actually a window rather than a page (?).
    You can do.
    Window mainWindow = Application.Current.MainWindow;
    The MainWindow is the first window opened, whether it's called mainwindow or banana or window1 or whatever.
    https://msdn.microsoft.com/en-us/library/system.windows.application.mainwindow%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
    Or you can find the usercontrol's parent.
    Window yourParentWindow = Window.GetWindow(userControl1);
    Once you have a reference you could call a public method on that.
    You would, naturally, have to define that in your window.
    Or page if it happens to be a page.
    Then you can do.
    Dispatcher.BeginInvoke((Action)delegate()
    MyParent.MyPublicMethod(SomePlainObjectParameter);
    SomePlainObjectParameter should be a plain class that doesn't involve any control's properties.
    This is all a bit tightly coupled though.
    I suggest you consider mvvm light messenger.  Messenger allows you to remove that dependency using the pub sub pattern.  Neither publisher nor subscriber need to have a reference to the other or even be aware they exist.
    http://social.technet.microsoft.com/wiki/contents/articles/26070.aspx
    This snippet is all in the same window code behind but the message send and subscribe would work in completely different classes.
    public MainWindow()
    InitializeComponent();
    Messenger.Default.Register<String>(this, (action) => ReceiveString(action));
    private void ReceiveString(string msg)
    MessageBox.Show(msg);
    Dispatcher.BeginInvoke((Action)delegate()
    tb.Text = msg;
    private void Button_Click(object sender, RoutedEventArgs e)
    Task.Factory.StartNew(() => {
    Messenger.Default.Send<String>("Hello World");
    The Type passed here as the message is String, you should define some other class of your own which you can send the data you want to use in.  The type is how the subscriber tells which message it is to 
    act on.
    The task,factory cranks up a new thread.
    That message is on that thread and the subscriber acts on that thread rather than the UI.
    Hence you still need the dispatcher.begininvoke stuff.
    Hope that helps.
    Technet articles: Uneventful MVVM;
    All my Technet Articles

  • WPF Data Grid Column Visibility Toggle Issue

    I have a WPF control that is used in multiple dialog forms. In one of these, I want to include a checkbox column along with two buttons that fire a method to either include all (check all the boxes) or exclude all (uncheck all the boxes.)
    I setup a Boolean variable to control this "IsExcludeVisible"
    Here is a snippet of the xaml:
    <Grid>  
    <Grid.ColumnDefinitions>
       <ColumnDefinition Width="Auto" />
       <ColumnDefinition Width="*"/>
     </Grid.ColumnDefinitions>
           <common:BaseDataGrid
      Name="grd"
      AutoGenerateColumns="False"            
      ItemsSource="{Binding ExcludeRoundingIngredientList}">
       <DataGrid.Columns>
         <DataGridTextColumn Header="Code" Binding="{Binding IngredientNumber}" />
         <DataGridTextColumn Header="Ingredient" Binding="{Binding Name}" />
               <DataGridCheckBoxColumn Header="Exclude"
    Visibility="{Binding IsExcludeVisible,
                                         Converter={StaticResource VisibilityConverter}}"
                                       Binding="{Binding MillBatchMixExclude}" />
               <DataGridComboBoxColumn Header="Rounding"
        DisplayMemberPath="Name"
                                    SelectedValuePath="RoundingId"
        SelectedValueBinding="{Binding MillBatchMixRoundingId}"
        ItemsSource="{Binding DataContext.RoundingOptions,Source={StaticResource Spy}}" />
         </DataGrid.Columns>
            </common:BaseDataGrid>
      <StackPanel ......
       <Button
        Content="Include All"
                    x:Name="btnIncludeAll"
    Visibility="{Binding IsExcludeVisible, Converter={StaticResource VisibilityConverter}}"
        csla:InvokeMethod.MethodName="IncludeAll"
        csla:InvokeMethod.TriggerEvent="Click"
        />
       <Button
        Content="Exclude All"
    Visibility="{Binding IsExcludeVisible, Converter={StaticResource VisibilityConverter}}"
        csla:InvokeMethod.MethodName="ExcludeAll"
        csla:InvokeMethod.TriggerEvent="Click"
        />
      </StackPanel>
     </Grid>...
    The button visibility toggles based on the IsExcludeVisible value as expected but the column visibility is totally unaffected.
    Am I missing something here (which obviously I am.)
    Below is my code to determine the value of the Boolean variable.
    public bool IsExcludeVisible
    get { return (SelectedReport.Name ==
    "Horizontal Batch Mix"); }
    Tom Mann MCSD C#

    I think the best way is to make a label function something
    like this (just off the top of my head, not tested):
    public function rate_label(item:Object,
    column:DataGridColumn):String
    return "GBP"+item.prdt_rate;
    Then in the DataGridColumn add a property:
    labelFunction="rate_label"

  • WPF Threading Backgroundworker issue

    I have two different background thread who does similar thing but at different time in my WPF application. both are right now independent background worker.
    1) first thread runs when you launch application, it downloads all images from connected printer to PC location.
    2) second thread does the same thing  when use click on some link in my application. 
    As both worker are independent, even though first thread's downloading process are still running, if user click on link the second thread start their work too 
    What I would like to do is, when user click on 2nd thread, is there any way I will know about status of first thread ? I mean if i know that first thread is doing it's work then I don't want to even start second thread. I need only second thread when first
    one got cancelled by some other reason.
    I heard about Mutex but I dont know how it works. Pls share ur idea and some example if you know how to handle this.
    Thanks
    Dee 

    Why even have a second instance of BackgroundWorker, why not just reuse the one that you already have?  At the very least re-use the variable, so that you remember to dispose of any previous instance.  If you are creating a new BackgroundWorker
    each time, without disposing of any previous instances, you are definitely going to have memory leaks.
    Something along these lines should work for you:
    Define a private property to track the BackgroundWorker:
    private BackgroundWorker m_Worker;
    Define your work and completed events:
    private void Work(object sender, DoWorkEventArgs e)
    // Do long running work
    private void WorkDone(object sender, RunWorkerCompletedEventArgs e)
    // Process the results
    // Clean up
    m_Worker.Dispose();
    m_Worker = null;
    And then your button click event, which I will leave up to you for the actual implementation for MVVM, if you are using it:
    private void ButtonClick(object sender, RoutedEventArgs e)
    if (m_Worker != null && m_Worker.IsBusy)
    return;
    m_Worker = new BackgroundWorker();
    m_Worker.DoWork += new DoWorkEventHandler(Work);
    m_Worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(WorkDone);
    m_Worker.RunWorkerAsync();
    It would be greatly appreciated if you would mark any helpful entries as helpful and if the entry answers your question, please mark it with the Answer link.

  • Issue with WPF validation(IDataErrorInfo) and loading User control Dynamically

    I have a user control and i use (IDataErrorInfo) for validation the problem is when i load User control Dynamically the validation not appears for the first time but when i load it in design time it works what is the problem ? here is the user control
    <UserControl x:Class="WeaponLibrary.WeaponUserControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="clr-namespace:WeaponLibrary"
    xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
    xmlns:ad="clr-namespace:DataAccessClassLibrary.ValidationRules;assembly=DataAccessClassLibrary"
    mc:Ignorable="d"
    d:DataContext="{d:DesignInstance local:WeaponUserControlViewModel}"
    Height="700" Width="730" FlowDirection="RightToLeft" Loaded="UserControl_Loaded" >
    <AdornerDecorator>
    <Expander IsExpanded="True" >
    <DockPanel>
    <WrapPanel DockPanel.Dock="Top" DataContext="{Binding Path=SelectedWeapon}">
    <StackPanel Width="315" Margin="20,0,10,0">
    <ComboBox x:Name="CmbWeaponType" IsReadOnly="True" IsEditable="True"
    ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor,
    AncestorType={x:Type UserControl}}, Path=DataContext.WeaponTypeList,ValidatesOnNotifyDataErrors =True,ValidatesOnDataErrors=True,
    NotifyOnValidationError=True,UpdateSourceTrigger=PropertyChanged}" DisplayMemberPath="weaponTypeName" SelectedValuePath="ID" >
    <ComboBox.SelectedValue>
    <Binding Path="weaponTypeID" Mode="TwoWay"
    UpdateSourceTrigger="PropertyChanged" ValidatesOnNotifyDataErrors="True" NotifyOnValidationError="True">
    </Binding>
    </ComboBox.SelectedValue>
    </ComboBox>
    </StackPanel>
    <StackPanel Width="315" Margin="20,0,10,0" >
    <TextBox x:Name="TxtWeaponNumber" Width="315" Text="{Binding weaponNumber,UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True ,ValidatesOnNotifyDataErrors=True,ValidatesOnDataErrors=True,NotifyOnSourceUpdated=True,NotifyOnTargetUpdated=True,ValidatesOnExceptions=True}" >
    <!--<TextBox.Text>
    <Binding Path="weaponNumber">
    <Binding.ValidationRules >
    <ad:RequiredRule ValidatesOnTargetUpdated="True" />
    </Binding.ValidationRules>
    </Binding>
    </TextBox.Text>-->
    </TextBox>
    </StackPanel>
    <StackPanel Width="315" Margin="20,0,10,0">
    <TextBox x:Name="TxtOwnership" Width="315"
    controls:TextBoxHelper.IsWaitingForData="True"
    Text="{Binding Path=ownership}" />
    </StackPanel>
    <StackPanel Width="315" Margin="20,0,10,0">
    <TextBox x:Name="TxtMagazineNumber" Width="315"
    controls:TextBoxHelper.IsWaitingForData="True"
    Text="{Binding Path=magazineNumber}" />
    </StackPanel>
    <StackPanel>
    <TextBox x:Name="TxtNotes" Margin="20,0,10,0" Width="660" Height="100"
    controls:TextBoxHelper.IsWaitingForData="True" Text="{Binding Path=note}" />
    </StackPanel>
    <StackPanel Width="660" Margin="10,10,10,0">
    <TextBlock Text="{Binding AllErrors}" Foreground="Red" >
    </TextBlock>
    </StackPanel >
    </WrapPanel>
    <DataGrid x:Name="DgvWeapons" Margin="0,10,0,10" VerticalContentAlignment="Center" ItemsSource="{Binding WeaponsList, Mode=OneWay,ValidatesOnNotifyDataErrors=False,NotifyOnValidationError=False}"
    HorizontalContentAlignment="Center" IsReadOnly="True" AlternatingRowBackground="{DynamicResource AccentColorBrush4}" SelectionMode="Single"
    CanUserDeleteRows="False" CanUserAddRows="False" AutoGenerateColumns="False" Width="657" SelectedItem="{Binding SelectedWeapon,ValidatesOnNotifyDataErrors=False,NotifyOnValidationError=False}" MouseLeftButtonDown="DgvWeapons_MouseLeftButtonDown">
    <DataGrid.Columns>
    <DataGridTextColumn Width="100" Binding="{Binding Path=WeaponTypeName}" />
    <DataGridTextColumn Width="100" Binding="{Binding Path=weaponNumber}"/>
    <DataGridTextColumn Width="100" Binding="{Binding Path=ownership}"/>
    <DataGridTextColumn Width="100" Binding="{Binding Path=magazineNumber}"/>
    <DataGridTextColumn Width="100" Binding="{Binding Path=note}"/>
    </DataGrid.Columns>
    </DataGrid>
    </DockPanel>
    </Expander>
    </AdornerDecorator>
    </UserControl>
    here is the code:
    var tabItem = new TabItem { Header = item.FormName };
    var adornerDecorator = new AdornerDecorator();
    var stackPanel = new StackPanel();
    stackPanel.Children.Add(item.MainForm);
    adornerDecorator.Child = stackPanel;
    tabItem.Content = adornerDecorator;
    tabItem.SetValue(ControlsHelper.HeaderFontSizeProperty, 18.0);
    MainTabControl.Items.Add(tabItem);

    hi
    i tried your way to know if there is an error
    the result is yes
    for the implementation of IDataErrorInfo
    here is the code :
    public string Error
                get
                    if (string.IsNullOrEmpty(weaponNumber))
                        return "error 1";
                    if (weaponTypeID == null || weaponTypeID == new Guid())
                        return "error2";
                    return string.Empty;
            public string this[string columnName]
                get
                    if (columnName == "weaponNumber")
                        bool valid = !string.IsNullOrEmpty(weaponNumber);
                        if (!valid)
                            return "error1";
                    if (columnName == "weaponTypeID")
                        bool valid = weaponTypeID != null && weaponTypeID != new Guid();
                        if (!valid)
                            return "error2";
                    return null;

  • WPF tab item design Issue !

    Hi,
    I am facing a situation with designing tab control.My requirement is depicted below:
    I have this tab called Precedent and I might have 2/3 more tabs depending on certain conditions  and then the remaining width of the tab control should  feature like a disabled tab item running through the entire width of the  tab control,
    as depicted above.
    But this is what I could achieve so far
    meaning, i couldnt make that disabled  default tab run through the entire width  of the tab control, as per my requirement.
    Can anyone please suggest what I have been missing here.
    Thanks
    Samjukta

    If I understand correctly.
    Basically, you want that greyed rounded bit behind the active tabs.
    I would be inclined to "cheat" and not have disabled tabs in there.
    Leaving just the one tab there.
    Put a rounded border of the appropriate colour behind your tabcontrol.
    Done.
    This isn't quite the right colour and I've obviously not styled the tabcontrol but it should give you the idea:
    <Grid Name="Root" >
    <Border Background="LightGray" CornerRadius="8,8,0,0"/>
    <TabControl >
    <TabItem>
    <TabItem.Header>
    <TextBlock Text="Precedent"/>
    </TabItem.Header>
    </TabItem>
    </TabControl>
    </Grid>
    Your question was about the tab headers.
    But....
    If you bind the itemssource of your tabcontrol you can easily add/remove entries from a collection of tabitems.
    Or you could just add or remove tabitems directly.
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

  • Visual Studio opening files when dragged and dropped in WPF app debugging session

    I'm working on a WPF app (using VS2013 CE) which is intended to manage media files (TV Shows, movies, etc) and as part of this I am enabling the user to drag and drop media files on to the running app (by adding AllowDrop="True" and PreviewDragEnter="Window_PreviewDragEnter"
    to my Window definition).
    The problem I have is that when I drag files onto the app in a debugging session Visual Studio then opens the file(s) when I stop debugging... this is seriously annoying as when I am testing with large media files (> 1GB) it just locks up VS for minutes
    at a time while it tries to open the file or files. When I run the app outside the debugger this does not happen - it's only when I'm in a VS debugging session.  The only way I can stop this happening is to kill VS completely from Task Manager then restart
    it - this is also very annoying but often I need to do this as it will freeze up for 5-10 minutes while it insists on loading the files in VS.
    I understand the app, whilst debugging, is running in the context of VS but why does VS then have to try to open the files when debugging is finished?   I have looked through the options but can't see anything to switch this off and no amount of searching
    has turned up anything - can anyone put me out of my misery with a solution to this annoying issue?

    Hello nzmike,
    Does Visual Studio behaves like the following image shows and just hangs when opening your media file?
    Do you have any other computer which installs Visual Studio? Can you reproduce this on it?
    In order to troubleshoot this issue I think we need to locate the root reason of your issue. The problem can related to the following:
    1. Your project is corrupt and VS then trys to load that file when debug finished.
    2. Your VS is corrupt and caused this problem.
    So please do something below:
    1. Try clean and rebuild your project.
    2. Switch to some other PCs and use VS and your project there, check if the problem can be reproduced.
    3. You can backup your VS setting and try some commands: devenv /resetsettings and devenv /resetuserdata
    Details about VS command:https://msdn.microsoft.com/en-us/library/xee0c8y7.aspx
    And based on th research of the above second step, if you can reproduce this issue on more than one PC, the problem is pending on your project and I need you to share a simple sample which can reproduce this issue. We will need to investigate the project
    in detail.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Does QTP/UFT support "Microsoft.Windows.Control" (one type of wpf control)?

    Hello,
    I have a challenge automating WPF Application in which they used new type of Wpf Data GridControl i.e "Microsoft.Windows.Control". We cannot access all the properties of this control(RowCount,GetCelldata). Can Anyone get this issue and provide me details of any patch that can resolve this issue?
    Please let me know if you need more info and provide resolution ASAP

    Hello,
    I have a challenge automating WPF Application in which they used new type of Wpf Data GridControl i.e "Microsoft.Windows.Control". We cannot access all the properties of this control(RowCount,GetCelldata). Can Anyone get this issue and provide me details of any patch that can resolve this issue?
    Please let me know if you need more info and provide resolution ASAP

Maybe you are looking for

  • Gnome 3 going into fallback mode

    "I just installed Arch as a virtual desktop using VMware Workstation. I have installed the drivers mentioned in the Wiki and the computer running it has excellent specs and shouldn't have a problem. Originally at the start of GDM there was an error m

  • Apple TV Energy friendly Screen saver - ALL BLACK?

    I've searched for all ways to dim screen savers or those best for plasma tvs to avoid screen burn On Apple TV. but what about a screen saver like on MacBooks that are all black to conserve energy? All these large and colorful images floating around a

  • Saving for playback on PSP

    I am having a difficult time saving iMovie (4.0.1) files for playback on a Sony PSP. The sharing options under iMovie allow for .MP4 files, but it seems that they are not the right codec maybe for playback? Has anyone had any luck sharing/exporting i

  • Unable to add Incoming Excise Invoice

    Hi All, While trying to add Incoming Excise Invoice, I'm gettin an error message,"Tax Definition, Message 173". I have checked the tax code and type, all the accounts are mapped here . What is causing this error and how to correctly add this document

  • Why I can`t my jpg in pdf change?

    Urgent!!!