XAML CLOSURE URI / TOKENS
360:   Void Populate:/UI/TerminalScreen/Production/ProductionStyles.axaml(System.IServiceProvider, Avalonia.Styling.Styles)  token=0x06014416 RVA=140721840321856
361:   Avalonia.Styling.Styles Build:/UI/TerminalScreen/Production/ProductionStyles.axaml(System.IServiceProvider)  token=0x06014417 RVA=140721840321888
362:   Void Populate:/UI/TerminalScreen/Trade/TradeStyles.axaml(System.IServiceProvider, Avalonia.Styling.Styles)  token=0x06014418 RVA=140721840321920
363:   Avalonia.Styling.Styles Build:/UI/TerminalScreen/Trade/TradeStyles.axaml(System.IServiceProvider)  token=0x06014419 RVA=140721840321952
364: 
365: ==========================================================================================
366: IL: CompiledAvaloniaXaml.!AvaloniaResources+XamlClosure_1216+XamlClosure_1218.Build token=0x06014D8E
367:   IL_0000: ldarg.0        
368:   IL_0001: ldc.i4.1       
369:   IL_0002: newarr         System.Object
370:   IL_0007: dup            
371:   IL_0008: ldc.i4.0       
372:   IL_0009: ldsfld         Avalonia.Markup.Xaml.XamlIl.Runtime.IAvaloniaXamlIlXmlNamespaceInfoProvider Singleton
373:   IL_000E: castclass      System.Object
374:   IL_0013: stelem.ref     
375:   IL_0014: ldstr          "avares://Game2.Client/UI/TerminalScreen/Inventory/InventoryItem.axaml"
376:   IL_0019: newobj         Void .ctor(System.IServiceProvider, System.Object[], System.String)
377:   IL_001E: stloc.0        
378:   IL_001F: ldarg.0        
379:   IL_0020: brfalse        IL_0054
380:   IL_0025: ldarg.0        
381:   IL_0026: ldtoken        Avalonia.Markup.Xaml.IRootObjectProvider
382:   IL_002B: call           System.Type GetTypeFromHandle(System.RuntimeTypeHandle)
383:   IL_0030: callvirt       System.Object GetService(System.Type)
384:   IL_0035: stloc.1        
385:   IL_0036: ldloc.1        
386:   IL_0037: brfalse        IL_0054
387:   IL_003C: ldloc.1        
388:   IL_003D: castclass      Avalonia.Markup.Xaml.IRootObjectProvider
389:   IL_0042: callvirt       System.Object get_RootObject()
390:   IL_0047: stloc.1        


INVENTORYGRID ITEMS FILLED
8308: 	private void InventoryItemsChanged(object? sender, NotifyCollectionChangedEventArgs? e)
8309: 	{
8310: 		if (_inventory != null)
8311: 		{
8312: 			RaisePropertyChanged(ItemsProperty, _inventory.InventoryItems, _inventory.InventoryItems);
8313: 		}
8314: 	}
8315: 
8316: 	private IEnumerable ItemsFilled()
8317: 	{
8318: 		if (_itemsControl == null || _itemsControl.Bounds.Width == 0.0)
8319: 		{
8320: 			yield break;
8321: 		}
8322: 		_availableWidth = _itemsControl.Bounds.Width;
8323: 		int numberOfItems = 0;
8324: 		if (_inventory == null)
8325: 		{
8326: 			yield break;
8327: 		}
8328: 		foreach (InventoryItemModel inventoryItem in _inventory.InventoryItems)
8329: 		{
8330: 			numberOfItems++;
8331: 			yield return inventoryItem;
8332: 		}
8333: 		int? maxStacks = MaxStacks;
8334: 		if (maxStacks.HasValue)
8335: 		{
8336: 			int maxStacks2 = maxStacks.GetValueOrDefault();
8337: 			for (int i = numberOfItems; i < maxStacks2; i++)
8338: 			{
8339: 				numberOfItems++;
8340: 				yield return null;
8341: 			}
8342: 			yield break;
8343: 		}
8344: 		int num = (int)Math.Floor(_availableWidth / ItemSize);
8345: 		if (num != 0)
8346: 		{
8347: 			for (int i = num - numberOfItems % num; i > 0; i--)
8348: 			{
8349: 				numberOfItems++;
8350: 				yield return null;
8351: 			}
8352: 		}
8353: 	}


INVENTORYLIST ITEMSOURCE
9145: 		ItemsControl itemsControl2;
9146: 		ItemsControl itemsControl = (itemsControl2 = new ItemsControl());
9147: 		((ISupportInitialize)itemsControl).BeginInit();
9148: 		border4.Child = itemsControl;
9149: 		ItemsControl itemsControl4;
9150: 		ItemsControl itemsControl3 = (itemsControl4 = itemsControl2);
9151: 		context.PushParent(itemsControl4);
9152: 		StyledProperty<IEnumerable?> itemsSourceProperty2 = ItemsControl.ItemsSourceProperty;
9153: 		ReflectionBindingExtension reflectionBindingExtension12 = new ReflectionBindingExtension("InventoryContainers");
9154: 		context.ProvideTargetProperty = ItemsControl.ItemsSourceProperty;
9155: 		Binding binding13 = reflectionBindingExtension12.ProvideValue(context);
9156: 		context.ProvideTargetProperty = null;
9157: 		itemsControl4.Bind(itemsSourceProperty2, binding13);
9158: 		itemsControl4.Background = new ImmutableSolidColorBrush(16777215u);
9159: 		itemsControl4.Classes.Add("InventoryListBox");
9160: 		DataTemplate dataTemplate;
9161: 		DataTemplate itemTemplate = (dataTemplate = new DataTemplate());
9162: 		context.PushParent(dataTemplate);
9163: 		dataTemplate.Content = XamlIlRuntimeHelpers.DeferredTransformationFactoryV2<Control>(XamlClosure_1229.Build, context);
9164: 		context.PopParent();
9165: 		itemsControl4.ItemTemplate = itemTemplate;
9166: 		context.PopParent();


SETINVENTORIES CLEAR + REBUILD
9470: 		Clear();
9471: 		_inventoryContainersSubscription.Dispose();
9472: 	}
9473: 
9474: 	public void Clear()
9475: 	{
9476: 		foreach (InventoryContainerViewModel item in _inventoryContainers.Items)
9477: 		{
9478: 			item.InventoryChanged -= OnInventoryChanged;
9479: 			item.DetachAndDispose();
9480: 		}
9481: 		_inventoryContainers.Clear();
9482: 		PrimaryFilters.Clear();
9483: 		_lastNonNullPrimaryFilter = null;
9484: 	}
9485: 
9486: 	public void SetInventories(IEnumerable<InventoryContainerViewModel> inventories)
9487: 	{
9488: 		using (Profiler.Begin("Terminal.Inventory.SetInventories", Profiler.Color.Null, 232, "C:\\BuildAgent\\work\\22d44cc391f3755\\KeenSWH\\Stable_VS2.4\\Game2\\Sources\\Game2.Client\\UI\\TerminalScreen\\Inventory\\InventoryListViewModel.cs"))
9489: 		{
9490: 			Clear();
9491: 			foreach (InventoryContainerViewModel inventory in inventories)
9492: 			{
9493: 				inventory.InventoryChanged += OnInventoryChanged;
9494: 				_inventoryContainers.Add(inventory);
9495: 			}
9496: 			RebuildPrimaryFiltersList();
9497: 			ApplySecondaryFilters();
9498: 		}
9499: 	}
9500:

