Skip to content

Commit

Permalink
Temp removal of container provider extension
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianSuess committed Aug 4, 2024
1 parent 39d99e7 commit e3cf4c9
Showing 1 changed file with 30 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System;
/*
* TODO: Fix me for Avalonia
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Threading;
using Avalonia.Controls;
Expand Down Expand Up @@ -101,16 +104,16 @@ public void CanResolvedNamedServiceUsingProperty(string name)
private const string _xamlWithMarkupExtension =
@"<Window
xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
xmlns=""https://github.com/avaloniaui""
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
xmlns:prism='http://prismlibrary.com/'
xmlns:mocks='clr-namespace:Prism.IocContainer.Avalonia.Tests.Support.Mocks;assembly=Prism.IocContainer.Avalonia.Tests.Support'
DataContext='{prism:ContainerProvider mocks:IService}' />";
private const string _xamlWithXmlElement =
@"<Window
xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
xmlns=""https://github.com/avaloniaui""
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""
xmlns:prism='http://prismlibrary.com/'
xmlns:mocks='clr-namespace:Prism.IocContainer.Avalonia.Tests.Support.Mocks;assembly=Prism.IocContainer.Avalonia.Tests.Support'>
<Window.DataContext>
Expand All @@ -128,23 +131,32 @@ public void CanResolveServiceFromXaml(string xaml)
// and Window.DataContext will be null.
object dataContext = null;
var thread = new Thread(() =>
try
{
////using (var reader = new StringReader(xaml))
////{
//// var window = XamlServices.Load(reader) as Window;
//// dataContext = window.DataContext;
////}
var window = AvaloniaRuntimeXamlLoader.Load(xaml) as Window;
dataContext = window.DataContext;
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
var thread = new Thread(() =>
{
////using (var reader = new StringReader(xaml))
////{
//// var window = XamlServices.Load(reader) as Window;
//// dataContext = window.DataContext;
////}
var window = AvaloniaRuntimeXamlLoader.Load(xaml) as Window;
dataContext = window.DataContext;
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
}
catch (Exception ex)
{
Console.WriteLine("Issue resolving AXAML: " + ex);
Debug.WriteLine("Issue resolving AXAML: " + ex);
}
Assert.Same(_unnamedService, dataContext);
}
}
}
*/

0 comments on commit e3cf4c9

Please sign in to comment.