Git Product home page Git Product logo

fsmapper's Introduction

fsmapper

NOTE:
The fsmapper User's Guide is available here. Please refer to this guide for instructions on how to use fsmapper

app window

fsmapper is a Windows application designed to connect a variety of input and output devices to flight simulators. Originally, the development of fsmapper began to connect my DIY controller device, SimHID G1000, to FS2020. However, it has now evolved to encompass functionalities that allow the creation of a home cockpit using a wide range of devices.
fsmapper targets not only home cockpit builders aiming for an exact replica of a specific aircraft's cockpit, but also general flight simulator players who have limited equipment and space but want to efficiently operate a wide range of aircraft (The truth is, I fall into the latter category as well).

Although fsmapper offers a multitude of functions, it can be summarized into following three main aspects when viewed from the perspective of improving device and space utilization efficiency, as mentioned earlier.

  • Interaction between devices and FS2020
    You can reflect the operations of various devices, including custom-made ones, onto various cockpit controls. fsmapper utilize Gauge API, allows support for operations not configurable within FS2020's Controls options. Additionally, it's possible to mirror the status of in-flight aircraft lamps and instrument panels onto physical devices.
    The interaction rules between devices and FS2020 can be automatically adjusted to suit different aircraft.

  • Changes to Input Device Characteristics
    You can flexibly modify the characteristics and behaviors of input devices, such as altering the linearity of analog axes, changing polarity for alternate switch, generating events that account for the position and hysteresis of analog axes, and so on. This allows for consistent handling of the same throttle device across aircraft with and without afterburners, or enables adjustments for actions like fuel cut-off and thrust reversal.

  • Virtual instrument panel utilizing Touchscreen Monitors
    In a multi-monitor environment, you can construct virtual instrument panels on the screen. Particularly when using a touchscreen monitor, intuitive actions like tapping or flicking can be used to manipulate switches and knobs displayed on the screen. By configuring windows that pop out with [Right Alt] + [Mouse Click] as elements of the virtual instrument panel, constructing modern glass cockpits becomes seamless.
    fsmapper excels in handling FS2020's pop-out windows, allowing natural integration of these as part of the instrument panel by hiding title bars and window frames. It also offers workarounds for touch operation glitches inherent in FS2020's implementation.

If you watch this video, you'll get a better understanding of what can be achieved with fsmapper as described above.
In this video, A320's virtual instrument panels are assembled on a 10.5-inch touchscreen by combining six popup windows (FCU, PFD, ND, ECAM x 2, MCDU) and user-defined instruments and switches. Additionally, by dynamically switching and displaying the instrument panels, it enables diverse information representation and manipulation even on a small screen.

All the functionalities mentioned earlier are accessed through Lua 5.4 scripts. Although fsmapper is implemented as a Windows GUI application, it actually only features a dashboard to display operational status and a console function to show messages during script execution, particularly error messages. If there wasn't a necessity to allow users to select FS2020's pop-out windows, I believe it would have been implemented as a command-line interface (CLI).

fsmapper architecture

The diagram above illustrates how fsmapper works. fsmapper patiently waits for events (green arrows) such as operations from various input devices, touchscreen interactions, and changes in the aircraft's status within FS2020. Upon detecting an event, fsmapper executes the corresponding action. These actions are Lua function objects that allow interaction (orange arrows) with various objects such as aircraft controls within FS2020, graphical representation on the screen, and data output to devices, facilitated through Lua functions and Lua objects provided by fsmapper.

The 'Configuration File' specified by the user during fsmapper execution refers to the definition of the correspondence between these events and actions as a Lua script.

How to build and install

You can download and install binary packages from here.
If you build yourself, follow the steps below.

  1. Requirements
    Make sure that the following softwares are installed in advance.

    • Visual Studio 2022 whilch is instaled with folowing workloads:
      • Universal Windows Platform development
      • C++ desktop development
      • C++ game development
    • Flight Simulator 2020 SDK
    • nuget.exe should be placed at the folder which is indicated by PATH environment variable.
  2. Running a console
    Run cmd.exe or PowerShell.exe on any console. Note that environment variables must be set to complie x64 binaries.
    The one of easiest way is using the following shortcut made when Visual Studio was installed.

    • x64 Native Tools Command Prompt for VS 2022
  3. Downloading source codes

    $ git clone --recursive https://github.com/opiopan/fsmapper.git
  4. Preparing dependent modules
    Downloading and compiling Lua source codes and downloading vJoySDK will be done by following step.

    $ cd fsmapper\modules
    $ .\prepare_modules.bat
  5. Compiling

    $ cd ..\src
    $ nuget restore fsmapper.sln
    $ msbuild /p:Configuration=Release
  6. Making deployable package

    $ cd ..\deploy
    $ .\deploy.bat
  7. Installing
    Copy fsmmapper folder to any folder you want.

    $ xcopy fsmapper <DESTINATION_FOLDER_PATH>

Additional softwares

While not mandatory for running fsmapper, it's highly recommended to additionally install the following two pieces of software. fsmapper provides users with more convenient features by integrating with these softwares.

  • vJoy (Dwonload)
    vJoy is a device driver that functions as a virtual joystick. fsmapper offers multiple functions to alter button status, axis positions, and POV settings of the vJoy device.
    Through the use of the vJoy device, fsmapper provides highly flexible configurability for human interface devices.

  • MobiFlight WASM Module (GitHub)
    This WASM module, functioning as an add-on for FS2020, enables an external-process utility to execute arbitrary RPN script and monitor changes in the aircraft's internal state stored in local variables like LVARs. fsmapper gains unrestricted access to retrieve and modify aircraft states by communicating with the MobiFlight WASM Module operating within the FS2020 process.
    The easiest way to install the MobiFlight WASM Module is by downloading and installing the MobiFlight Connector from here.

    The vanilla fsmapper communicates with FS2020 through the SimConnect API, which allows an external process to access only SimVars and Event IDs. However, this access isn't sufficient to control all operable objects in a cockpit or retrieve all gauge statuses to display on another DIY gauge or virtual instrument panel.
    To control and access all cockpit gauges, accessing local variables within an aircraft module is necessary, and the Gauge API serves this purpose. Regrettably, this API can only be used within the WASM module.
    The MobiFlight WASM Module addresses this limitation, enabling fsmapper to access all local variables by communicating with this WASM module.

How to use fsmapper

Please refer the Tutrial and the Configuration Guide.

Supporting custom devices

fsmapper only supports Direct Input gaming devices and SimHID devices, but it provides a plugin API to support other devices.  A sample code of a simple plugin module and an example Lua script for its usage are prepared, so please refer to it.
The plugin DLL can be utilized by placing it in a folder named plugins under the folder where fsmapper.exe is located, or by placing it in the folder specified in the settings page.

Note that the sample code above will result in compilation errors in this location. The include folder and libraries referenced by this sample will be correctly placed via the deploy.bat script.
In other words, building the sample module included in this installation package here is straightforward.

Sample Scripts

This repository includes several configuration scritps for practical use of SimHID G1000 at here.
To use these scripts, vJoy driver and MobiFlight WASM module must be installed. In addition, it's assumed that the virtual serial Port for SimHID G1000 is recognaized as COM3 and the display for SimHID G1000 is secondary monitor (moniter No. is 2).
If your environment is not same, change config table defined at the top of each script as below according to your environment.

local config = {
    simhid_g1000_identifier = {path = "COM3"},
    simhid_g1000_display = 2,
}

Alternatively, you can define the override_config global variable in the Pre-run script of fsmapper's Settings page to override the contents of the config variable without directly modifying the script. This method also supports those who do not own the SimHID G1000 but want to try the operation of the virtual instrument panel.

Here is an example of a script to specify in the Pre-run script.

override_config = {
    simhid_g1000_display = 1,
    simhid_g1000_display_scale = 0.5,

    simhid_g1000_mock = true, 
    simhid_g1000_mock_proxy = {
        type = 'dinput',
        identifier = {name = 'your_device_name_here'},
        aux_up = 'button1',
        aux_down = 'button2',
        aux_push = 'button3',
    },
}

Please replace placeholders like "your_device_name_here" and specific button names with appropriate values for your setup. This script will override the configuration variables accordingly when fsmapper is launched.

Here is the meaning of each parameter.

Parameter Description
simhid_g1000_display Specify the display number for showing the virtual instrument panel. This display should ideally be a touchscreen, but it can also be operated using a mouse.
simhid_g1000_display_scale Specify the size of the virtual instrument panel display. Use 1 to use the entire screen.
simhid_g1000_mock If you are not using SimHID G1000 or do not own it at all, specify true.
simhid_g1000_mock_proxy The following sample scripts allow you to operate multiple virtual instrument panels by switching between them. This switching operation is assigned to the left and right AUX switches of SimHID G1000. If you are not using SimHID G1000, you can assign the switching operation to another device using this parameter.
Specify the device to use for this purpose in the identifier parameter. Refer to this guide for descriptions of the identifier parameters corresponding to the devices you own.
Specify which buttons of the device identified by identifier to use for switching virtual instrument panels using aux_up, aux_down, and aux_push parameters.

NOTE: More complex scripts can be found in this repository. I actually use the scripts stored in that repository, and the way how to switch the configuration correspond to current aircraft can be found in those scripts.

g1000.lua

This script can be used with all aircrafts which install Garmin G1000.
This script handles two poped out windows as captured windows, one is the PFD of G1000 and the other one is the MFD of G1000.
The contents displayed on the monitor of SimHID G1000 can be switched between the PFD and the MFD by operationg the switches placed at the right end of the SimHID G1000 housing and left end one.
All buttons and knobs of the SimHID G1000 are work for every displayed contents. For example, pushing the "menu" button cause displaying the menu on the PFD when the monitor of SimHID G1000 shows the PFD.

In this script, you can see the following example usage of fsmapper.

  • Basic eveent handling for SimHID device
  • Cockpit operable utits of a FS2020 aircraft by sending Event IDs
  • Poped out window of FS2020 handling (captured window function)
  • Switchable views

This script is added some codes to the aboeve script.
The deference between both scripts is only the part to handle logicool X56.
In this script, you can see the following example usage of fsmapper.

  • Basic event handling for USB gaming controller
  • Feeding values to vJoy device
  • Deferred event handling

a32nx.lua

This script was written for FlyByWire A32NX.
This is more complex than the above two scripts. This script provides the integrated virtual cockpit which contains physical operable units such as buttons and knobs, touch controllable units on the monitor, and poped out window contents such as PFD.
This script includes several sub-module scripts at here, and it also uses several bitmap image at here to render each operable units.

In this scrit, you can see the following example usage of fsmapper in addition to g1000_x56.lua case.

  • Observing the aircraft status represented by RPN script
  • Changing the aircraft status by executing RPN script
  • Drawing graphics on the screen
  • Handling the touch events and mouse events occured on the screen

This script defines following 6 views. Every view consist a FS2020 poped out instrument window and self rendered operable gauges.

Poped out instruments Self rendered operable units
1 PFD FCU display
buttons on the FCU
BARO indicator
2 ND buttons and toggle switches on the EFIS control unit
auto brake buttons
etc
3 Upper ECAM engine mode selectors, master engine switch and engine status indicators
APU control switches
battery control switches and voltage indicators
4 Lower ECAM ECAM page selector buttons
5 MCDU MCDU buttons
6 EFB -

The width of every view except EFB is a half width of the SimHID monitor width. So two views can be displayed simultaneously side by side.
By pressing soft-keys placed at bottom of SimHID G1000, two views to show can be specified.
And the switches placed on the left end and the right end of SimHID G1000 housing (AUX switches) can also control views to show. When you operate the AUX switch up or down, it will sequentially switch between three preset left-right view combinations. Pressing the AUX switch toggles between EFB display mode and other instrument display modes.

script for a32nx

The pushbuttons rendered on each view can be operated by tapping them. The toggle switches include engine master switches and the selector knobs can be operated by flicking them. The correspondence between SimHID G1000 operations and A32NX operations are shown below.

SimHID G1000 A32NX
NAV volume knob SPD/Mac knob on FCU
The pull operation is emulated by a long press
NAV swap button Pulling Speed Knob on FUC
HDG knob HDG/TRK knob on FCU
The pull operation is emulated by a long press
HDG button Pulling HDG/TRK knob on FCU
AP button AP1 button on FCU
FD button FD button on EFIS
APR button APPR button on FCU
ALT outer knob Increase / Decrease altitute indicator on FCU by 1000 feet
ALT inner knob Increase / Decrease altitute indicator on FCU by 100 feet
ALT knob push button Pushing ALT knob on FCU
The pull operation is emulated by a long press
FLC button Pulling ALT knob on FCU
COM volume knob V/S or FPA knob on FCU
The pull operation is emulated by a long press
COM swap button Pulling V/S or FPA knob on FCU
COM knob Freequency selector knob on RMP panel
BARO knob rotation Manipuration of the value displayed in the barometer reference window
BARO knob push button Switching barometer reference mode between QNH and standard barometer reference
Range knob rotation Range selector switch on EFIS
Range knob joystick Changing the mode displayed on the respective ND
NAV inner knob Adjusting the brightness of PFD, ND, upper ECAM, and lower ECAM in sync
NAV outer knob Adjusting the brightness of both the weather rader image and the EGPWS terrain image on ND
FMS inner knob Adjusting the brightness of FCU display
FMS outer knob Adjusting the brightness of all glareshields in sync

c172.lua

This script was written for Cessna 172 Skyhawk analogue instruments version that contains in delux edition.
This is the example how to implement reusable visual component. The following instruments are implemented as a component and each component written as one lua script at here.

  • Garmin GNS530 (GPS and NAVCOM)
  • Garmin GNS430 (GPS and NAVCOM)
  • Bendix King KAP 140 (Autopilot Control)
  • Bendix King KT 76C (Transponder)
  • Bendix King KR 87 (ADF)
  • Heading Indicator with Heading Bug
  • Cource Diviation Indicator
  • ADF Indicator
  • Buttons and Indicators whch is used to select navigation source (Sorry, I don't know the model name or official name)

This script defines three views. The above components are placed in different positions, different sizes, and different combinations on each view.
You can switch between these views with the switches placed on the left end and the right end of SimHID G1000 housing.

Almost component can be activated with tapping it. Component in active state can be distinguished by some areas turning emerald green.
A part of phisical buttons and knobs on SimHID G1000 will only affect component in active state.
For example, Course of CDI for NAV1 can be changed by rotationg course knob on SimHID G1000 only when CDI for NAV1 is activated.

Other various components can be found at here.

fsmapper's People

Contributors

opiopan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sim2reality

fsmapper's Issues

X-PLANE

Hi,
Is it possible to support X-PLANE?

0.8.1 problems

Hi, um trying the fsmapper 0.8.1, the screen shows the pfd mfd image, the events and actions shows ALL commands but nothing happens on the game.

69254396463__279DD88A-684A-40E8-B8A9-5B3A351F1A2F.MOV

Unable to lanch fsmapper.exe

Firstly, I would like to give a big thank to the author created this fantastic hardware and software.

OS: Windows11
IDE and compiler: VS 2022

After I sucessfully build the application and click fsmapper.exe, it doesn't lanch.
So I tried to use the debug tool of VS2022, it shows some "unhandle exception" .

Here is the error message. Apologize some parts are in Mandarin. Thanks again for the help and creating this application.

Unhandled exception at 0x00007FF808A5BA08 (Microsoft.ui.xaml.dll) in fsmapper.exe: 0xC000027B: 發生應用程式內部例外狀況。 (parameters: 0x000001936FA2DC90, 0x0000000000000004).

Unhandled exception at 0x00007FF8EFB618DF (combase.dll) in fsmapper.exe: 0xC0000602: 發生立即失敗例外狀況。將不啟動例外處理常式,並將立即終止處理程序。.

Unhandled exception at 0x00007FF808638164 (Microsoft.ui.xaml.dll) in fsmapper.exe: 0xC000027B: 發生應用程式內部例外狀況。 (parameters: 0x000001936FA2DD80, 0x0000000000000003).

Unhandled exception at 0x00007FF8EFB618DF (combase.dll) in fsmapper.exe: 0xC0000602: 發生立即失敗例外狀況。將不啟動例外處理常式,並將立即終止處理程序。.

Microsoft.UI.Xaml.dll!00007FF808B49A15: (caller: 00007FF802D4AEAB) ReturnHr(1) tid(2cd8) 80070057 parameters error。
Microsoft.UI.Xaml.dll!00007FF808B49A15: (caller: 00007FF802D4AEAB) ReturnHr(2) tid(2cd8) 80070057 parameters error。
Microsoft.UI.Xaml.dll!00007FF808B49A15: (caller: 00007FF802D4AEAB) ReturnHr(3) tid(2cd8) 80070057 parameters error。

Unable to launch fsmapper.exe

After I switch to the newest commit. I successfully built it but fail to launch it.

OS: Windows11
IDE and compiler: VS 2022

The followings are the error message I got from VS 2022 debug console. I tried to run it in debug mode and set GUI project as startup project. I am not sure if it is correct to debug all projects.
Thanks again for answering my question and creating this project!!

'fsmapper.exe' (Win32): Loaded 'C:\Users\ycchen\code\fsmapper\src\x64\Debug\fsmapper.exe'. Symbols loaded.
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Users\ycchen\code\fsmapper\src\x64\Debug\fsmappercore.dll'. Symbols loaded.
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\dwmapi.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. 
'fsmapper.exe' (Win32): Unloaded 'C:\Windows\System32\combase.dll'
'fsmapper.exe' (Win32): Loaded 'C:\Users\ycchen\code\fsmapper\src\x64\Debug\Microsoft.WindowsAppRuntime.Bootstrap.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140d.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140d.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140_1d.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbased.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Users\ycchen\code\fsmapper\src\x64\Debug\SimConnect.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\WinSxS\amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.22000.675_none_ce846f9a12fab040\GdiPlus.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\d2d1.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\d3d10_1.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\ws2_32.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Users\ycchen\code\fsmapper\src\x64\Debug\fsmapperhook.dll'. Symbols loaded.
'fsmapper.exe' (Win32): Loaded 'C:\Users\ycchen\code\fsmapper\src\x64\Debug\vJoyInterface.dll'. Module was built without symbols.
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\dinput8.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\setupapi.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\imagehlp.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\d3d11.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\d3d10_1core.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\hid.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140_1.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\dxgi.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\InputHost.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\CoreMessaging.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\windows.storage.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\uxtheme.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\SHCore.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\cryptbase.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\clbcatq.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\AppExtension.dll'. 
'fsmapper.exe' (Win32): Loaded 'C:\Windows\System32\Windows.StateRepositoryPS.dll'. 
D:\a\_work\1\s\dev\WindowsAppRuntime_BootstrapDLL\MddBootstrap.cpp(469)\Microsoft.WindowsAppRuntime.Bootstrap.dll!00007FF8B8B52F4F: (caller: 00007FF8B8B5225D) Exception(1) tid(2fe1c) 80070491 There was no match for the specified key in the index.
    Msg:[AppExtension.Name=microsoft.winappruntime.ddlm-1.0-x6, Major=1, Minor=0, Tag=, MinVersion=0.319.455.0] 
D:\a\_work\1\s\dev\WindowsAppRuntime_BootstrapDLL\MddBootstrap.cpp(125)\Microsoft.WindowsAppRuntime.Bootstrap.dll!00007FF8B8B63D61: (caller: 00007FF62E32410E) ReturnHr(1) tid(2fe1c) 80070491 There was no match for the specified key in the index.
    Msg:[D:\a\_work\1\s\dev\WindowsAppRuntime_BootstrapDLL\MddBootstrap.cpp(469)\Microsoft.WindowsAppRuntime.Bootstrap.dll!00007FF8B8B52F4F: (caller: 00007FF8B8B5225D) Exception(1) tid(2fe1c) 80070491 There was no match for the specified key in the index.
    Msg:[AppExtension.Name=microsoft.winappruntime.ddlm-1.0-x6, Major=1, Minor=0, Tag=, MinVersion=0.319.455.0] 
] 
Exception thrown at 0x00007FF947EE474C in fsmapper.exe: Microsoft C++ exception: wil::ResultException at memory location 0x0000001584EFCAA0.
Exception thrown at 0x00007FF947EE474C in fsmapper.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
The thread 0x2e490 has exited with code 2147943569 (0x80070491).
The thread 0x2d188 has exited with code 2147943569 (0x80070491).
The thread 0x2eab0 has exited with code 2147943569 (0x80070491).
The thread 0x2b2c8 has exited with code 2147943569 (0x80070491).
The thread 0x2ec40 has exited with code 2147943569 (0x80070491).
The thread 0x2fea8 has exited with code 2147943569 (0x80070491).
The thread 0x2eaa4 has exited with code 2147943569 (0x80070491).
The thread 0x2d91c has exited with code 2147943569 (0x80070491).
The thread 0x2fee0 has exited with code 2147943569 (0x80070491).
The program '[183300] fsmapper.exe' has exited with code 2147943569 (0x80070491).

Navigationview Header // Change header and navigate to page.

Following your code in "MainWindow.xaml.cpp" i tried to add Headers parts and changing them while navigating to pages.
That's what i did but doesn't work:

void MainWindow::NavigationView_SelectionChanged(winrt::Microsoft::UI::Xaml::Controls::NavigationView const& sender, winrt::Microsoft::UI::Xaml::Controls::NavigationViewSelectionChangedEventArgs const& args)
    {
        std::wstring header;

        if (args.IsSettingsSelected()) 
        {
            // Navigate to Settings.
            contentFrame().Navigate(::xaml_typename<TD2_WinUI3::SettingsPage>());
        }
        else if (args.SelectedItemContainer())
        {
            auto tag = winrt::unbox_value_or<winrt::hstring>(args.SelectedItemContainer().Tag(), L"");
            for (auto&& page : m_win) 
            {
                if (page.first == tag) 
                {
                    // Change header and navigate to page.
                    header : m_headers;
                    sender.Header(winrt::box_value(header.c_str()));
                    contentFrame().Navigate(page.second, nullptr, args.RecommendedNavigationTransitionInfo());
                }
            }
        }
    }

can you help?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.