Search results for query: *

  1. R

    How to detect if on foreground thread or not in Core from class assembly

    The basic problem is this: The environment is WPF/Core/Class Library. The goal is to detect if a method is operating on the foreground or background and, if BG, transition to foreground and assert some values to properties that are bound to UI elements. In Framework, the standard method for...
  2. R

    How to access allocated memory as either an array of shorts or an array of bytes

    A C# application needs to allocate memory and treat that block as either an array of bytes or an array of shorts. Here's what I've tried. A structure was declared that was supposed to have a byte[] and a short[] occupying the same memory space. [StructLayout(LayoutKind.Explicit)]...
  3. R

    How to detect if on foreground thread or not in Core from class assembly

    In Framework, this is easily accomplished by including a reference to the PresentationFramework class assembly and then using something like this: public static void UIThread( Action action ) { if (Application.Current.Dispatcher.CheckAccess()) { // On FG thread. Can directly...
Back
Top Bottom