I have a Window (WPF) using the Fluent.Ribbon ribbon control.
In said ribbon, I have buttons which perform different tasks.
For the commands, I created a static class, containing read-only properties returning the commands.
For the first of the buttons, this method worked perfectly, however, the second command doesn't seem to be found.
I used the exact same syntax I used for the first command, but I keep getting the above error.
I've tried cleaning the solution/build, building the solution and debugging. All to no avail.
Here's my code:
<Fluent:RibbonGroupBox Header="Device Operations">
<Fluent:Button Command="cmd:MainWindowCommands.SearchForNewDevices" Header="Search for Devices" Icon="{DynamicResource searchForDevices}" LargeIcon="{DynamicResource searchForDevicesLarge}" />
<Fluent:Button Command="cmd:MainWindowCommands.AddNewDevice" Header="Add Device" Icon="{DynamicResource addDevice}" LargeIcon="{DynamicResource addDeviceLarge}" /> <!-- This is where the error occurs -->
</Fluent:RibbonGroupBox>
And here's the class containing the commands:
using System;
namespace Beatsleigher.eMMCDumper.Commands {
using Beatsleigher.eMMCDumper.ViewModels;
using GalaSoft.MvvmLight.CommandWpf;
public static class MainWindowCommands {
private static RelayCommand searchForNewDevicesCommand;
/// <summary>
/// Gets the search for new devices command.
/// Created by: Beatsleigher
/// At: 12.06.2015, 11:18
/// On: BEATSLEIGHER-PC
/// </summary>
/// <value>
/// The search for new devices command.
/// </value>
public static RelayCommand SearchForNewDevices {
get {
return searchForNewDevicesCommand == null ? searchForNewDevicesCommand = new RelayCommand(MainWindowVM.Instance.SearchForDevicesExecute) : searchForNewDevicesCommand;
}
}
private static RelayCommand addNewDeviceCommand;
/// <summary>
/// Gets the add new device command.
/// Created by: Beatsleigher
/// At: 12.06.2015, 22:35
/// On: BEATSLEIGHER-PC
/// </summary>
/// <value>
/// The add new device.
/// </value>
public static RelayCommand AddNewDevice {
get {
return addNewDeviceCommand == null ? addNewDeviceCommand = new RelayCommand(MainWindowVM.Instance.AddNewDevice) : addNewDeviceCommand;
}
}
}
}
Thanks in advance for any and all help!
Related
Problem Summary
I am trying to create an offline tiled map for a WPF application that uses telerik. The user does not need to zoom in very far. I am having trouble finding a source of tiles that can be implemented with telerik.
What I've tried
I am using RadMap from telerik for WPF. They have an option for implementing tiles from a custom tile provider. I have been trying to follow the solutions given in this forum and this forum. They recommend downloading tiles from Easy OpenStreetMap Downloader, but it the file format does not match the code. It appears in the code, the tiles should be grouped in folders according to zoom level, then in a folder according to x coordinate. However, it looks to me like openstreetmaps downloader groups them by y coordinate only. I either need to get openstreetmaps downloader to save the tiles in this format, or to find another provider that will.
Code
Here is the telerik code that I am trying to base my solution off of:
/// <summary>
/// Tile source which read map tiles from the file system.
/// </summary>
public class FileSystemTileSource : TiledMapSource
{
private string tilePathFormat;
/// <summary>
/// Initializes a new instance of the FileSystemTileSource class.
/// </summary>
/// <param name="tilePathFormat">Format string to access tiles in file system.</param>
public FileSystemTileSource(string tilePathFormat)
: base(1, 20, 256, 256)
{
this.tilePathFormat = tilePathFormat;
}
/// <summary>
/// Initialize provider.
/// </summary>
public override void Initialize()
{
// Raise provider intialized event.
this.RaiseIntializeCompleted();
}
/// <summary>
/// Gets the image URI.
/// </summary>
/// <param name="tileLevel">Tile level.</param>
/// <param name="tilePositionX">Tile X.</param>
/// <param name="tilePositionY">Tile Y.</param>
/// <returns>URI of image.</returns>
protected override Uri GetTile(int tileLevel, int tilePositionX, int tilePositionY)
{
int zoomLevel = ConvertTileToZoomLevel(tileLevel);
string tileFileName = this.tilePathFormat.Replace("{zoom}", zoomLevel.ToString(CultureInfo.InvariantCulture));
tileFileName = tileFileName.Replace("{x}", tilePositionX.ToString(CultureInfo.InvariantCulture));
tileFileName = tileFileName.Replace("{y}", tilePositionY.ToString(CultureInfo.InvariantCulture));
if (File.Exists(tileFileName))
{
return new Uri(tileFileName);
}
else
{
return null;
}
}
}
/// <summary>
/// Map provider which read map tiles from the file system.
/// </summary>
public class FileSystemProvider : TiledProvider
{
/// <summary>
/// Initializes a new instance of the MyMapProvider class.
/// </summary>
/// <param name="tilePathFormat">Format string to access tiles in file system.</param>
public FileSystemProvider(string tilePathFormat)
: base()
{
FileSystemTileSource source = new FileSystemTileSource(tilePathFormat);
this.MapSources.Add(source.UniqueId, source);
}
/// <summary>
/// Returns the SpatialReference for the map provider.
/// </summary>
public override ISpatialReference SpatialReference
{
get
{
return new MercatorProjection();
}
}
}
public MainWindow()
{
InitializeComponent();
this.radMap.Provider = new FileSystemProvider("Path to OpenStreet Images\\{zoom}\\{x}\\os_{x}_{y}_{zoom}.png");
}
I have a file named App.xml that is included in my installer(will be installed on the client computer) which I want to load data from and display it to the user so he can manipulate what will be installed/ how to use the system.
I've tried using Xml Files extensions/ custom actions, checked online, couldn't find a way to load a source file embedded in the installer.
my file is:
<App> <Text>bla bla</text></App>
I want the installer to show the "bla bla" text and the user can change it which can later be saved through an extension as usual..
thanks!
I've run into a similar problem. Digging around for a solution that allows you to use an XML file during the InstallUISequence, before files are installed, it looks like you need to add a custom table to your WiX definition as described here.
Basically, you create a CustomTable element in your .wxs file, for your example something like:
<CustomTable Id="App">
<Text>bla bla</Text>
</CustomTable>
Then you can read from it in a c# custom action by creating a View query to find the desired properties:
using (View view = session.Database.OpenView("SELECT 'Text' FROM 'App'"))
{
view.Execute();
// access view properties and turn them into some object you want to manipulate
}
I'll admit some ignorance as to what that view object is going to have, but I know you can iterate through its records or grab individual columns, poking around in the properties should eventually find you the values you want.
Next step is to populate a combobox element with the values
<Control Id="DropdownSelectLabel" Type="Text" X="50" Y="65" Width="200" Height="15" TabSkip="no" Text="&Select a value:">
</Control>
<Control Id="DropdownSelect" Type="ComboBox" Height="16" Width="200" X="60" Y="80" Property="MY_PROPERTY_KEY" ComboList="yes">
<ComboBox Property="MY_PROPERTY_KEY">
<!-- Optional prepopulate value-->
<ListItem Text="[dummy_text]" Value="[dummy_value]" />
</ComboBox>
</Control>
I'm populating it with a custom c# action running during the InstallUISequence, built through visual studio
<!-- Custom action for populating the combobox -->
<CustomAction Id="CA_PopulateComboBox" BinaryKey="BIN_CustomActions" DllEntry="PopulateComboBox" Execute="firstSequence" />
<!-- Binaries for the custom action -->
<Binary Id="BIN_CustomActions" SourceFile="..\PATH-TO-YOUR-CUSTOM-ACTION-BIN-RELEASE.CA.dll" />
<!-- Schedule the custom action -->
<InstallUISequence>
<Custom Action="CA_PopulateComboBox" Before="LaunchConditions" />
</InstallUISequence>
Custom action looks like this:
public class CustomActions
{
/// <summary>
/// Populates the ComboBox UI Element.
/// </summary>
/// <param name="session">The session.</param>
[CustomAction]
public static void PopulateComboBox(Session session)
{
session.Log("Populating the combobox with certificates");
// Clear the combobox (unecessary if it starting empty)
View view = session.Database.OpenView("DELETE FROM ComboBox WHERE ComboBox.Property='MY_PROPERTY_KEY'");
view.Execute();
view = session.Database.OpenView("SELECT * FROM ComboBox");
view.Execute();
List<ComboBoxRecordWrapper> valuesToAdd = PopulateValuesObjects(session); // Add the logic to read your xml values from the session object here
var index = 1;
foreach (ComboBoxRecordWrapper valueObject in valuesToAdd)
{
session.Log($"Adding value to the combobox: {valueObject.Text} - {valueObject.Value} {Environment.NewLine}Order: {valueObject.Order}");
view.Modify(ViewModifyMode.InsertTemporary, recordWrapper.ToRecord());
view.Execute();
index++;
}
view.Close();
}
}
/// <summary>
/// Class ComboBoxRecordWrapper. Wraps objects that should be represented in a combobox element in the installer
/// </summary>
public class ComboBoxRecordWrapper
{
/// <summary>
/// Gets or sets the property that this element's value will be stored as if the element is selected
/// </summary>
/// <value>The property.</value>
public string Property { get; set; }
/// <summary>
/// Gets or sets the order that this element appears in the combobox
/// </summary>
/// <value>The order.</value>
public int Order { get; set; }
/// <summary>
/// Gets or sets the value of the combobox option. This is what will be available to the UI element as a returned value
/// </summary>
/// <value>The value.</value>
public string Value { get; set; }
/// <summary>
/// Gets or sets the text that will be displayed for this element
/// </summary>
/// <value>The text.</value>
public string Text { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ComboBoxRecordWrapper"/> class.
/// </summary>
/// <param name="property">The property.</param>
/// <param name="order">The order.</param>
/// <param name="value">The value.</param>
/// <param name="text">The text.</param>
public ComboBoxRecordWrapper(string property, int order, string value, string text)
{
this.Property = property;
this.Order = order;
this.Value = value;
this.Text = string.IsNullOrEmpty(text) ? value : text;
}
/// <summary>
/// Converts to a record to add to the MSI database.
/// </summary>
/// <returns>Record.</returns>
public Record ToRecord()
{
var record = new Record(4);
record.SetString(1, this.Property);
record.SetInteger(2, this.Order);
record.SetString(3, this.Value);
record.SetString(4, this.Text);
return record;
}
}
This would be custom functionality that you would have to provide through a custom action. From a high level design I see you passing in the path to the xml file on the command line. At run time your custom action would read the nodes in the file and set the appropriate properties that your text boxes are using.
I m hitting the following error on my new windows 10 universal app C#/XAML:
An exception of type 'System.InvalidCastException' occurred in GalaSoft.MvvmLight.Platform.dll but was not handled in user code
Additional information: Unable to cast object of type '' to type 'Windows.UI.Xaml.Controls.Frame'.
on the following navigating command in one of my page's view model:
_navigationService.NavigateTo(ViewModelLocator.MedicineBoxPageKey);
I am trying to have a hamburger menu style navigation (see this sample). app by Microsoft on an example of how to do this) to:
1- have a convenient solution shared across all my pages. The sample mentioned above uses an AppShell Page as the root of the app instead of a Frame, that encapsulates the navigation menu and some behavior of the back button. That would be ideal.
2- Use the MVVM-Light navigation service to handle all the navigation from my view model conveniently.
Here is how the App.xml.Cs initializes the shell page onLaunched:
AppShell shell = Window.Current.Content as AppShell;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (shell == null)
{
// Create a a AppShell to act as the navigation context and navigate to the first page
shell = new AppShell();
// Set the default language
shell.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
shell.AppFrame.NavigationFailed += OnNavigationFailed;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
}
// Place our app shell in the current Window
Window.Current.Content = shell;
if (shell.AppFrame.Content == null)
{
// When the navigation stack isn't restored, navigate to the first page
// suppressing the initial entrance animation.
shell.AppFrame.Navigate(typeof(MedicinesStorePage), e.Arguments, new Windows.UI.Xaml.Media.Animation.SuppressNavigationTransitionInfo());
}
// Ensure the current window is active
Window.Current.Activate();
And here is the AppShell class definition:
public sealed partial class AppShell : Page
{
public static AppShell Current = null;
public AppShell()
{
this.InitializeComponent();
}
}
From what I have tried so far, the mvvm-light navigation service only works when a Frame is used a root of the app and note a Page (otherwise we get this casting bug).
However using a Frame does not seem to be a option either since as the sample app puts it:
Using a Page as the root for the app provides a design time experience as well as ensures that
when it runs on Mobile the app content won't appear under the system's StatusBar which is visible
by default with a transparent background. It will also take into account the presence of software
navigation buttons if they appear on a device. An app can opt-out by switching to UseCoreWindow.
I also tried to overide the navigationTo method from the mvvm-light navigation service but the bug seems to occur before I could catch it.
Does anyone has a solution to use the mvvm-light navigation service and a shell page as the app root (that manages the hamburger menu, etc.)?
Thanks a lot!
I talked to Laurent Bugnion and he recommended me to implemented my own navigation service who handles the navigation. For this I made a PageNavigationService who implements the INavigationService Interface of MVVM Light.
public class PageNavigationService : INavigationService
{
/// <summary>
/// The key that is returned by the <see cref="CurrentPageKey" /> property
/// when the current Page is the root page.
/// </summary>
public const string RootPageKey = "-- ROOT --";
/// <summary>
/// The key that is returned by the <see cref="CurrentPageKey" /> property
/// when the current Page is not found.
/// This can be the case when the navigation wasn't managed by this NavigationService,
/// for example when it is directly triggered in the code behind, and the
/// NavigationService was not configured for this page type.
/// </summary>
public const string UnknownPageKey = "-- UNKNOWN --";
private readonly Dictionary<string, Type> _pagesByKey = new Dictionary<string, Type>();
/// <summary>
/// The key corresponding to the currently displayed page.
/// </summary>
public string CurrentPageKey
{
get
{
lock (_pagesByKey)
{
var frame = ((AppShell) Window.Current.Content).AppFrame;
if (frame.BackStackDepth == 0)
{
return RootPageKey;
}
if (frame.Content == null)
{
return UnknownPageKey;
}
var currentType = frame.Content.GetType();
if (_pagesByKey.All(p => p.Value != currentType))
{
return UnknownPageKey;
}
var item = _pagesByKey.FirstOrDefault(
i => i.Value == currentType);
return item.Key;
}
}
}
/// <summary>
/// If possible, discards the current page and displays the previous page
/// on the navigation stack.
/// </summary>
public void GoBack()
{
var frame = ((Frame) Window.Current.Content);
if (frame.CanGoBack)
{
frame.GoBack();
}
}
/// <summary>
/// Displays a new page corresponding to the given key.
/// Make sure to call the <see cref="Configure" />
/// method first.
/// </summary>
/// <param name="pageKey">
/// The key corresponding to the page
/// that should be displayed.
/// </param>
/// <exception cref="ArgumentException">
/// When this method is called for
/// a key that has not been configured earlier.
/// </exception>
public void NavigateTo(string pageKey)
{
NavigateTo(pageKey, null);
}
/// <summary>
/// Displays a new page corresponding to the given key,
/// and passes a parameter to the new page.
/// Make sure to call the <see cref="Configure" />
/// method first.
/// </summary>
/// <param name="pageKey">
/// The key corresponding to the page
/// that should be displayed.
/// </param>
/// <param name="parameter">
/// The parameter that should be passed
/// to the new page.
/// </param>
/// <exception cref="ArgumentException">
/// When this method is called for
/// a key that has not been configured earlier.
/// </exception>
public void NavigateTo(string pageKey, object parameter)
{
lock (_pagesByKey)
{
if (!_pagesByKey.ContainsKey(pageKey))
{
throw new ArgumentException(
string.Format(
"No such page: {0}. Did you forget to call NavigationService.Configure?",
pageKey),
"pageKey");
}
var shell = ((AppShell) Window.Current.Content);
shell.AppFrame.Navigate(_pagesByKey[pageKey], parameter);
}
}
/// <summary>
/// Adds a key/page pair to the navigation service.
/// </summary>
/// <param name="key">
/// The key that will be used later
/// in the <see cref="NavigateTo(string)" /> or <see cref="NavigateTo(string, object)" /> methods.
/// </param>
/// <param name="pageType">The type of the page corresponding to the key.</param>
public void Configure(string key, Type pageType)
{
lock (_pagesByKey)
{
if (_pagesByKey.ContainsKey(key))
{
throw new ArgumentException("This key is already used: " + key);
}
if (_pagesByKey.Any(p => p.Value == pageType))
{
throw new ArgumentException(
"This type is already configured with key " + _pagesByKey.First(p => p.Value == pageType).Key);
}
_pagesByKey.Add(
key,
pageType);
}
}
}
Basicly it's a copy of his implementation. But instead of parsing to a Frame I parse to an AppShell and use the AppFrame Property to navigate.
I put this to my ViewModelLocator. Instead of:
var navigationService = new NavigationService();
I will just use:
var navigationService = new PageNavigationService();
EDIT: I Noticed that there is an excpetion in the NavMenuListView when you use the backkey after you navigated with the new navigationservice since the selected item is null. I fixed it with adjusting the SetSelectedItem Method and adding a nullcheck in the for loop after the cast:
public void SetSelectedItem(ListViewItem item)
{
var index = -1;
if (item != null)
{
index = IndexFromContainer(item);
}
for (var i = 0; i < Items.Count; i++)
{
var lvi = (ListViewItem) ContainerFromIndex(i);
if(lvi == null) continue;
if (i != index)
{
lvi.IsSelected = false;
}
else if (i == index)
{
lvi.IsSelected = true;
}
}
}
But there might be a more elegant solution than this.
i have program with some user controls but when i build solutions the user controls don't appear on tool box, for test i made another user control and after re build it appeared on tool box ! this is one of my user controls:
using System.Drawing;
using System.Windows.Forms;
namespace AMIgo
{
/// <summary>A UserControl used to display and interact with the active calls.</summary>
/// <remarks>This display reflect the content of the <see cref="AMI_Client.AstCallsList"/> which contains the current active calls.
/// The ListViewCalls display allows to show the items in differents layouts, in a similar way than the windows file explorer.
/// <para>A menu allows to select to display Inbound( show in Red (default), Outbound (shown in blue) and internal (shown in gray) calls.</para>
/// <para>Properties allows to set the font and colors of the ListView and ListItems</para>
/// <para>Drag / Drop: You can drag an active call and drop it onto an extension in the <see cref="ListViewLines"/> display to Transfer a
/// caller to an extension. You can drag and drop an active call to the display toolbar drop target to Transfer the active channel to the
/// selected destination, to park the call or to hang it up. You can also drag an active channel to the <see cref="AMIgoDropTarget"/> form to Transfer a call to the selected destination.
/// (Extension, queue, conference, etc)</para>
/// <para> Context Menu: Right click on an item to open a Context menu.</para>
/// <seealso cref="AstCall"/><seealso cref="AMI_Client.NewCallEvent"/></remarks>
[ToolboxBitmap(typeof(AMIgo.ListViewCalls), "Resources.Control_ListView.bmp")]
public partial class ListViewCalls : AMIgoControl
{
/// <summary>Gets or sets a value indicating whether the intermediary agents channels are displayed.</summary>
/// <value><c>true</c> to show Agents channels otherwise, <c>false</c>.</value>
public bool ShowAgentsChannels { get; set; }
private bool _show_outbound_calls;
/// <summary>Gets or sets a value indicating whether the outbound calls are displayed.</summary>
/// <value><c>true</c> to show outbound calls, otherwise, <c>false</c>.</value>
public bool ShowOutboundCalls
{
get { return (_show_outbound_calls); }
set
{
_show_outbound_calls = value;
outboundToolStripMenuItem.Checked = _show_outbound_calls;
}
}
private bool _show_internal_calls;
.
.
.
.
.
and this is AMIgoControl file...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
namespace AMIgo
{
/// <summary>
/// This is the base control from which inherit most of the AMIgo controls
/// </summary>
[DesignTimeVisible(false)]
[System.ComponentModel.ToolboxItem(false)]
public class AMIgoControl : UserControl
{
/// <summary>true after this control has been initialized. </summary>
public bool _InitDone;
/// <summary>Gets or sets the AMI_Client instance. The AMI_Client component will set this on startup if left blank.</summary>
public virtual AMIgo.AMI_Client AMI_ClientInstance { get; set; }
/// <summary>Initializes a new instance of the <see cref="AMIgoControl"/> class.</summary>
public AMIgoControl() { }
/// <summary>Initializes a new instance of the <see cref="AMIgoControl"/> class. </summary>
/// <param name="AMI_ClientInstance">The AMI_Client instance.</param>
public AMIgoControl(AMIgo.AMI_Client AMI_ClientInstance)
{
this.AMI_ClientInstance = AMI_ClientInstance;
}
/// <summary>Finds a Control recursively. Note finds the first match and exits</summary>
/// <param name="Container">The container to search for the given control type.
/// Remember all controls (Panel, GroupBox, Form, etc are all containers for controls
/// </param>
/// <param name="TypeName">Name of the type of control to look for</param>
/// <returns>The control object if found or null</returns>
///
public Control FindControlRecursive(Control Container, string TypeName)
{
if (Container.GetType().Name == TypeName)
return Container;
foreach (Control ctrl in Container.Controls)
{
Control foundCtrl = FindControlRecursive(ctrl, TypeName);
if (foundCtrl != null)
return foundCtrl;
}
return null;
}
} //UserControl
Just for the starters: Toolbox in VS applies context filters so, you won't see the user controls unless you have a designer opened and active in the document well. If you have tried this and still don't see the controls - would you be able to post a screenshot for better understanding? Also, mention the version of VS you are using - I just tried creating a sample UC on VS12 and it works just as expected. Perhaps, you might want to do that test too and post the update with result.
update: by the way, you might want to remove that ToolboxItem(false) attribute on AMIgo class.
Ello all,
In my custom activity, when I drop an activity into the WorkflowItemPresenter, save and compile, my activity suddenly disappears and I have no freakin clue why. I'm probably making some noob mistake somewhere but, I'm not seeing it. I've gone back and made sure my code complies fine and deleted and re-added my assembly containing the custom activity on the off chance it might just be a fluke. After which when I attempt to compile from the project referencing my custom activity. It runs but throws an ArgumentNullException. I've tried passing it bools, conditionals and just about anthing else it would take all ending with the same result. Any suggestions on troubleshooting ideas to try in this case or obvious stuff missing?
Here is my reference to my condition ActivityFunc <bool> Condition.
<sap:WorkflowItemPresenter
HintText="Add Trigger conditional activities here"
Item="{Binding Path=ModelItem.Condition.Handler}"
Height="40"
/>
Here is my reference to the child I want to schedule after the condition returns true public ActivityAction Child.
<sap:WorkflowItemPresenter
HintText="Add activies that happen on trigger firing"
Item="{Binding Path=ModelItem.Child.Handler}"
Height="40"/>
Here is my Custom activity
[Designer(typeof(TriggerDesigner)),
Description("Creates a Trigger for use by trigger conditionals"), ToolboxCategory(ToolboxCategoryAttribute.Trigger),
ToolboxBitmap(typeof(Shaolin.Activities.ToolboxIconAttribute), "ToolboxIcons.CreateImportContext")]
public sealed class Trigger : NativeActivity
{
/// <summary>
/// The initial Condition that determines if the trigger should be scheduled
/// </summary>
/// <value>The condition.</value>
public ActivityFunc<bool> Condition { get; set; }
/// <summary>
/// The resulting action that is scheduled if the Condition is true
/// </summary>
/// <value>The child.</value>
public ActivityAction Child { get; set; }
/// <summary>
/// Gets or sets the value holding whether or not the trigger matches the condition
/// </summary>
/// <value>The type of the match.</value>
public MatchType MatchType{ get; set; }
/// <summary>
/// Perform evaluation of Condition; if is true then schedules Child
/// </summary>
/// <param name="context">The execution context in which the activity executes.</param>
protected override void Execute(NativeActivityContext context)
{
context.ScheduleFunc<bool>(this.Condition, new CompletionCallback<bool>(OnConditionComplete));
}
/// <summary>
/// Called from Execute when Condition evaluates to true.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="instance">The instance.</param>
/// <param name="result">if set to <c>true</c> [result].</param>
public void OnConditionComplete(NativeActivityContext context, ActivityInstance instance, bool result)
{
//check if Condition evaluation returns true
if (result)
{
//If so then schedule child Activity
context.ScheduleAction(Child);
}
}
}
}
Hello person with the same IP as me.
ModelItem.Condition is null. Your binding fails, therefore, but with little fanfare which makes this situation hard to figure out.
You need to implement IActivityTemplateFactory and configure your activity in the Create method:
Activity IActivityTemplateFactory.Create(System.Windows.DependencyObject target)
{
return new Trigger
{
DisplayName = "lol trigger",
Condition = new ActivityFunc<bool>(),
Child = new ActivityAction(),
MatchType = MatchType.Lol
};
}