elmish / Elmish.WPF

Static WPF views for elmish programs
Other
421 stars 68 forks source link

3rd-party custom Window : Building fine but not showing at runtime #587

Closed YkTru closed 7 months ago

YkTru commented 7 months ago

Elmish Version: <PackageReference Include="Elmish.WPF" Version="4.0.0-beta-54" />

namespace TestNamespace

open Elmish.WPF
open DevExpress.Xpf.Core

module TestApp =

(...) 

    let DesignViewModel = ViewModel.designInstance (init ()) (bindings ())

    let main (window: ThemedWindow) =
        WpfProgram.mkSimple init update bindings |> WpfProgram.startElmishLoop window
using DevExpress.Xpf.Core;

namespace Application1.WPF;

public partial class MainWindow : ThemedWindow
{
    public MainWindow()
    {
        InitializeComponent();
    }
using TestNamespace;
using System.Windows;
using DevExpress.Xpf.Core;

namespace Application1.WPF;

public partial class App : Application
{
    public App()
    {
        Activated += StartElmish;
    }

    private void StartElmish(object sender, EventArgs e)
    {
        Activated -= StartElmish;
        TestApp.main((ThemedWindow) MainWindow);
    }
}
<dx:ThemedWindow
    x:Class="Application1.WPF.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vm="clr-namespace:TestNamespace;assembly=Application1"
    d:DataContext="{x:Static vm:TestApp.DesignViewModel}"
    Height="400"
    Width="600"
    Background="Gray"
    PreviewKeyDown="MainWindow_OnPreviewKeyDown"
    RoundWindowCorners="True"
    ShowIcon="False"
    WindowStartupLocation="CenterScreen"
    mc:Ignorable="d">
    <Grid/>
</dx:ThemedWindow>

I really hope Elmish.WPF is not limited to the basic "Window", or I forgot/misunderstood something.

Thank you

TysonMN commented 7 months ago

Can you share a GitHub repository that reproduces this problem?

YkTru commented 7 months ago

Here: https://github.com/YkTru/Elmish.WPF-ThemedWindow

YkTru commented 7 months ago

@TysonMN In fact, do you have access to Devexpress to test? Unless it is not Dx related?

Thank you

TysonMN commented 7 months ago

I don't have access to Dev Express. You will have to include all dependencies so this is easily reproducible.

YkTru commented 7 months ago

Resolved: I went with .Net7 instead of .Net8

marner2 commented 7 months ago

@YkTru I have an active development branch for upgrading to .NET 8 (#588 ).

Would you be able to retest this case with that PR version of Elmish and Dev Express? If it works, I can push a quick release so that you can use the new .NET 8 features. Thanks!

YkTru commented 7 months ago

Hi sorry for the late answer;

the "issue" is on DevExpress side : https://www.devexpress.com/products/net/controls/wpf/

Though they said .Net8 is now supported, I'll wait for it to be official

YkTru commented 2 months ago

@YkTru I have an active development branch for upgrading to .NET 8 (#588 ).

Would you be able to retest this case with that PR version of Elmish and Dev Express? If it works, I can push a quick release so that you can use the new .NET 8 features. Thanks!

Hi just wanted to say that all is working fine for me with Devexpress 22, ElmishWpf 4 beta, and .Net8