- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I am very new to C# but I'm trying to get into it. Forgive me if this topic has been discussed multiple times. I am trying to create a simple form in Revit that gets activated with an IExternalCommand. I am running into an issue that I cannot seem to figure out with the InitializeComponent(); line of code in the .xaml.cs code.
Here is the form creation:
<Window x:Class="Detail_Line_Creation.LineStylesWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Detail_Line_Creation"
mc:Ignorable="d"
Title="Available Line Styles" Height="400" Width="300">
<Grid>
<ListBox Name="LineStyleList" Margin="10"/>
</Grid>
</Window>
And here is my xaml.cs code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Detail_Line_Creation
{
/// <summary>
/// Interaction logic for UserControl2.xaml
/// </summary>
public partial class LineStylesWindow : Window
{
public LineStylesWindow(List<string> lineStyleNames)
{
InitializeComponent();
LineStyleList.ItemsSource = lineStyleNames;
}
}
}
I get the CS0103 error code for the InitializeComponent(); as well as for the LineStyleList.
Could anyone help shed some light on what I need to do here? I believe I have all the correct references and assemblies loaded in.
Thanks so much.
Solved! Go to Solution.