Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

Jayme65

@Jayme65
About
Posts
28
Topics
20
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Binding "SelectedItems" of a Listbox
    J Jayme65

    Hi, Could you please help me figure out how I could bind "SelectedItems" of a listbox? Here I have a 'listbox_2' that contains a list of fruits and vegetables ;) There's another 'listbox_1' that contains groups of fruits and vegetables (under a list format...maybe is it my first error? Should it rather be a list of fruits/vegetables?) and a recipe. I would like that on each group selection (in listbox_1), the corresponding fruits and vegetables would be selected (in listbox_2)...and make it possible to modify that list https://i.imgur.com/nENJTCY.jpg Unfortunately, the way to achieve this behavior stays obscure to me...could you please help? Here's what I've set up untill now: C#

    public partial class MainWindow : Window
    {
    ItemList il;
    GroupList gl;

        public MainWindow()
        {
            InitializeComponent();
        }
        private void Window\_Loaded(object sender, RoutedEventArgs e)
        {
            il = new ItemList();
            ICollectionView cvs = CollectionViewSource.GetDefaultView(il);
            cvs.SortDescriptions.Add(new SortDescription("\_type", ListSortDirection.Ascending));
            cvs.SortDescriptions.Add(new SortDescription("\_name", ListSortDirection.Ascending));
            cvs.GroupDescriptions.Add(new PropertyGroupDescription("\_type"));
            ListBox2.ItemsSource = cvs;
    
            gl = new GroupList();
            ICollectionView cvt = CollectionViewSource.GetDefaultView(gl);
            ListBox1.ItemsSource = cvt;
        } 
    }
    
    public class Item
    {
        public string \_type { get; set; }
        public string \_name { get; set; }
        public Item()
        {
        }
    }
    public class ItemList : ObservableCollection {
        public ItemList() {
            base.Add(new Item() { \_type = "fruit", \_name = "apple" });
            base.Add(new Item() { \_type = "vegetable", \_name = "potato" });
            base.Add(new Item() { \_type = "fruit", \_name = "banana" });
            base.Add(new Item() { \_type = "vegetable", \_name = "tomato" });
            base.Add(new Item() { \_type = "fruit", \_name = "pear" });
            base.Add(new Item() { \_type = "vegetable", \_name = "salad" });
            base.Add(new Item() { \_type = "fruit", \_name = "orange" });
            base.Add(new Item() { \_type = "vegetable", \_name = "onion" }); 
        }
    }
    
    public class Group
    {
        public string \_groupname { get;
    
    WPF help csharp dotnet wpf wcf

  • Coverflow like animating grids or contentcontrol
    J Jayme65

    I don't have access anymore to the computer (school) I used at the time!

    WPF tutorial com question

  • Coverflow like animating grids or contentcontrol
    J Jayme65

    Hi, That's really frustrating, some days ago I felt on a tutorial page on how to animate grids (or contentcontrol...I don't remember). ...and now that I need this page I can't find it again ;-) There was an illustration like this (light blue squares) http://i.imgur.com/PzcdoVs.png[^] The principle being to animate scale in/out for centered object and opacity in/out for first and last object Would you by chance see the page I'm referring to? (or at least lead me to a similar article!) Thanks a lot!!

    WPF tutorial com question

  • Dynamic ContentControl > Style > DataTemplate....binding problem!
    J Jayme65

    Hi, I have to create some ContentControl code behind and be able to change their content and their DataTemplate according to their data type (image or text) (So, I've created a ContentControl code behind, given it (code-behind too) a style from the XAML. In this style I've set DataTemplates) I'm blocked with a binding problem! The 'person' object is displaying but I can't get to its 'display_text' property! Could you please help? Thanks!! PS: By the way, my goal is to create containers dynamically, then send them a 'person' object and have a picture displayed if available or a text displayed (if image not available)...so, if you have other suggestions on how to achieve this they all are welcome!! ;-)

            <Setter Property="ContentTemplate" Value="{StaticResource ccTexte}"/>
            <!--<Setter Property="ContentTemplate" Value="{StaticResource ccImage}"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding Source={StaticResource display\_image}}" Value="{x:Null}">
                    <Setter Property="ContentTemplate" Value="{StaticResource ccTexte}"/>
                </DataTrigger>
            </Style.Triggers>-->
    
    WPF wpf help wcf tutorial question

  • Request for advice: 3D realistic scene interface
    J Jayme65

    Hi, I would like your enlightened advice on this matter: For my next application I have to setup an interface in 3D. The interface will be an office with a desktop and some usual items like pens, papers, telephone, lamp, etc... There won't be complex animation, just slight rotation around the desktop BUT...the scene has to be rendered in a very realistic way, offering a 'global illumination' (like?) quality display! (realistic light effects and shadows) How should I realize this? Will I have to use a 3D game engine? If so, which one would you advice me to use? My question is not on the content of the scene (a 3D graphic artist will manage this) but on how to achieve a realtime high quality render of the scene! Thank you very much!

    C# question lamp game-dev tutorial workspace

  • Loading resources from XAML, problem with fonts
    J Jayme65

    I am (I have to) using an XAML file as a resource from my main window. In this simplified example, the XAML file looks like this

    The file is loaded that way (the XAML file, as well as a 'image1.jpg' file, are in a 'Resources' folder along with the exe file)

    Imports System.IO
    Class MainWindow
    Private Sub MainWindow_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
    loadInterface()
    End Sub
    Sub loadInterface()
    ' Load xaml file as content of the window
    Dim GridUri As String = System.AppDomain.CurrentDomain.BaseDirectory & "Resources\theme.xaml"
    Dim fs As FileStream = New FileStream(GridUri, FileMode.Open, FileAccess.Read)
    Dim sri = TryCast(System.Windows.Markup.XamlReader.Load(fs), Grid)
    Me.Content = sri
    fs.Close()
    End Sub
    End Class

    ..and that works nicely Now I would like to use a label whit a font file taken in the same 'Resources' folder (the font used in this example: http://www.dafont.com/fr/digital-7.font)

    <Label FontFamily="pack://siteoforigin:,,,/Resources/#Digital-7" Content="Have a nice day!"/>
    

    ...but then the label text isn't displayed with the proper FontFamily! What should I please do for the text of the label to be displayed using the font in the resources folder? Thanks very much!! PS: the font file CAN'T be in resource of the application. Think of this XAML as a theme, any font could be inside and the application couldn't have all those possible fonts in resources!

    WPF html css wpf com help

  • Setting Primary Display
    J Jayme65

    It returns a 0 (DISP_CHANGE_SUCCESSFUL) !!

    Visual Basic help question

  • Setting Primary Display
    J Jayme65

    Hi, I'm trying to set the Primary Display...without success! Here's the code I'm working on, would you please help me see what I'm doing wrong there? There's no compilation error...it simply doesn't give the expected result! Thank you!!

    Imports System.Runtime.InteropServices
    Class MainWindow
    Const CCDEVICENAME As Short = 32
    Const CCFORMNAME As Short = 32

    Private Const MONITORINFOF\_PRIMARY As Integer = &H1
    Private Const DISPLAY\_DEVICE\_ATTACHED\_TO\_DESKTOP As Integer = &H1
    Private Const DISPLAY\_DEVICE\_PRIMARY\_DEVICE As Integer = &H4
    Private Const DISPLAY\_DEVICE\_MIRRORING\_DRIVER As Integer = &H8
    Private Const DISPLAY\_DEVICE\_VGA\_COMPATIBLE As Integer = &H10
    Private Const DISPLAY\_DEVICE\_REMOVABLE As Integer = &H20
    Private Const DISPLAY\_DEVICE\_MODESPRUNED As Integer = &H8000000
    
    Private Const DM\_POSITION = &H20
    Private Const DM\_DISPLAYORIENTATION = &H80 ' XP only
    Private Const DM\_BITSPERPEL = &H40000
    Private Const DM\_PELSWIDTH = &H80000
    Private Const DM\_PELSHEIGHT = &H100000
    Private Const DM\_DISPLAYFLAGS = &H200000
    Private Const DM\_DISPLAYFREQUENCY = &H400000
    'Private Const DM\_DISPLAYFIXEDOUTPUT As Long = &H20000000 ' XP only
    
    Private Const ENUM\_CURRENT\_SETTINGS As Integer = -1
    Private Const ENUM\_REGISTRY\_SETTINGS As Integer = -2
    Private Const EDS\_RAWMODE As Integer = &H2
    
    Private Const CDS\_UPDATEREGISTRY As Integer = &H1
    Private Const CDS\_TEST As Integer = &H2
    Private Const CDS\_FULLSCREEN As Integer = &H4
    Private Const CDS\_GLOBAL As Integer = &H8
    Private Const CDS\_SET\_PRIMARY As Integer = &H10
    Private Const CDS\_VIDEOPARAMETERS As Integer = &H20
    Private Const CDS\_NORESET As Integer = &H10000000
    Private Const CDS\_RESET As Integer = &H40000000
    Private Const CDS\_FORCE As Integer = &H80000000
    Private Const CDS\_NONE As Integer = 0
    
    Public Structure PointL
        Dim x As Integer
        Dim y As Integer
    End Structure
    
    \_
    Enum DisplayDeviceStateFlags As Integer
        AttachedToDesktop = &H1
        MultiDriver = &H2
        PrimaryDevice = &H4
        MirroringDriver = &H8
        VGACompatible = &H10
        Removable = &H20
        ModesPruned = &H8000000
        Remote = &H4000000
        Disconnect = &H2000000
    End Enum
    
    '0 is Not Attached
    
    Const DISPLAY\_PRIMARY\_DEVICE = &H4 'Primary device
    
    'Holds the information of display adpter
    Private Structure DISPLAY\_DEVICE
    
    Visual Basic help question

  • Trouble setting cooperative level [SharpDX]
    J Jayme65

    Hi, I'm using SharpDX for DirectInput joystick management...and I can't resolve the problem I get while setting cooperative level

    Imports SharpDX
    Imports SharpDX.DirectInput
    Imports System.Windows.Interop

    Class MainWindow
    Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
    MainForJoystick()
    End Sub
    '
    Private Shared Sub MainForJoystick()
    ' Initialize DirectInput
    Dim directInput As New DirectInput

        ' Find a Joystick Guid
        Dim joystickGuid = Guid.Empty
    
        For Each deviceInstance As DeviceInstance In directInput.GetDevices(DeviceType.Gamepad, DeviceEnumerationFlags.AllDevices)
            joystickGuid = deviceInstance.InstanceGuid
        Next
    
        ' If Gamepad not found, look for a Joystick
        If joystickGuid = Guid.Empty Then
            For Each deviceInstance As DeviceInstance In directInput.GetDevices(DeviceType.Joystick, DeviceEnumerationFlags.AllDevices)
                joystickGuid = deviceInstance.InstanceGuid
            Next
        End If
    
        ' If Joystick not found, throws an error
        If joystickGuid = Guid.Empty Then
            Debug.Print("No joystick/Gamepad found.")
        End If
    
        ' Instantiate the joystick
        Dim hwnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).EnsureHandle()
        Dim joystick = New Joystick(directInput, joystickGuid)
        joystick.SetCooperativeLevel(hwnd, CooperativeLevel.Foreground)
        Debug.Print("Found Joystick/Gamepad with GUID: {0}", joystickGuid)
    
        ' Set BufferSize in order to use buffered data.
        joystick.Properties.BufferSize = 128
    
        ' Acquire the joystick
        joystick.Acquire()
    
        ' Poll events from joystick
        While True
            joystick.Poll()
            Dim datas = joystick.GetBufferedData()
            For Each state As JoystickUpdate In datas
                Debug.Print(state.ToString)
                ' Example detecting 'Up' button
                If state.Offset = 60 Then
                    If state.Value = 128 Then
                        Debug.Print("Up button pressed")
                    End If
                End If
            Next
        End While
    End Sub
    

    End Class

    The problem comes from here: joystick.SetCooperativeLevel(hwnd, CooperativeLevel.Foreground) SharpDX.SharpDXException was unhandled HResult=-2147024809 Message=HRESUL

    WPF help com debugging tutorial

  • Setting BitmapImage.UriSource in a XAML file read with XamlReader [VB][WPF]
    J Jayme65

    Hello, My WPF application (WpfApplication1) is, for its XAML part, composed of an single empty grid. Elements are loaded inside this grid from an external XAML file, read through XamlReader. This external Xaml file contains (for the purpose of this example) a URL to an image which should be located in the 'My documents' user folder. The problem is that during importation the url from images should be relative to the application which is loading the file! In other words, this URL should be relative to the application (pack://siteoforigin:, pack://application) ...and in my case, this path is 'outside' from that context and should be built this way: Environment.GetFolderPath(Environment.SpecialFolde r.MyDocuments) & "Theme\" So, I wrote a Converter, hoping to build the complete path url...but without succes!! > 'Impossible to create the unknow type '{clr-namespace:WpfApplication1}imgurlConvert'.' The application XAML part:

    The application VB part:

    Imports System.IO
    Class MainWindow
    Public Shared ThemeTempFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\Theme\"
    Public Shared themeGrid As Grid
    Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
    Debug.Print(ThemeTempFolder)
    loadInterface()
    End Sub
    Sub loadInterface()
    ' Load extracted (grid) xaml file as content of the window
    Dim GridUri As String = ThemeTempFolder & "theme.xaml"
    Dim fs As FileStream = New FileStream(GridUri, FileMode.Open, FileAccess.Read)
    Dim sri = TryCast(System.Windows.Markup.XamlReader.Load(fs), Grid)
    Me.Content = sri
    fs.Close()
    ' Liens, dans le code, aux ?l?ments de l'interface charg?e en Xaml.
    themeGrid = LogicalTreeHelper.FindLogicalNode(sri, "themeGrid")
    End Sub
    End Class
    Public Class imgurlConvert
    Implements IValueConverter
    Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
    Di

    WPF wpf csharp html css dotnet

  • PathListBox animation by code
    J Jayme65

    Hi, I'm creating a carousel using a PathListBox. Everything's working fine..if I use buttons (and Interaction.Behaviors)

            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ec:PathListBoxItem}">
                        <Grid Height="150" Width="200">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.35" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="fillColor"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="contentPresenter"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="SelectionStates">
          </x-turndown>
    
    WPF css

  • Please help interpreting debug output
    J Jayme65

    Hi, One of the users of my application is complaining that he can't open the application. He gave me the debug output of the crashed application...unfortunately I'm not an expert and have difficulties to manage it...would you please give me some help and help me understand why the application is crashing on his system? Thanks!!! ------------------------------ Callstack: WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl() + 0xac bytes WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(object state) + 0x38 bytes mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0xa7 bytes mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0x16 bytes mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x41 bytes WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke() + 0x5b bytes WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue() + 0x16b bytes WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0x5a bytes WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0x9b bytes WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) + 0x6b bytes WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) + 0x56 bytes WindowsBase.dll!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(object source, System.Delegate method, object args, int numArgs, System.Delegate catchHandler) + 0x3a bytes WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs) + 0x10e bytes WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) + 0xf1 bytes [Native to Managed Transition] [Managed to Native Transition] WindowsBase.dll!System.Windows.T

    Visual Basic c++ debugging help question

  • Sound doesn't play instantly...but wait for next operation to complete!!
    J Jayme65

    It doesn't work better. Well, I had posted a simple code, hoping that it would be more clear for users to help me...but I'm afraid that I'd better post something very similar to my actual code..if I want the problem to be clearly exposed...and help you to try to help me ;-) There's a sound class, called UISound:

    Imports System.Threading
    Public Class UISound
    Dim writingPath As String = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) & "\_UI Sounds\"
    Public Shared WithEvents uiPlayer As New WMPLib.WindowsMediaPlayer
    Public Shared uiThread As Thread = New Thread(AddressOf ReceiveSound)
    Public Shared Sub ReceiveSound(ByVal url As String)
    uiThread = New Thread(AddressOf PlayFile)
    uiThread.Start(url)
    End Sub
    Public Shared Sub PlayFile(ByVal url As String)
    uiPlayer.URL = writingPath & url
    uiPlayer.controls.play()
    End Sub
    End Class

    The sound is called from a sub in the MainWindow...which itself fires other subs in cascade that involve a heavy compute time:

    Sub one()
    UISound.ReceiveSound("sound1.wav")
    Dim a As Integer = 0
    For i As Integer = 0 To 999999999
    a = i
    Next
    Two()
    End Sub
    Sub two()
    Dim a As Integer = 0
    For i As Integer = 0 To 999999999
    a = i
    Next
    Three()
    End Sub
    Sub Three()
    Dim a As Integer = 0
    For i As Integer = 0 To 999999999
    a = i
    Next
    End Sub

    It appears that the sound is played after the whole "cascade" is runned, so after Sub Three() End. If you try this code you will verify that inserting

    System.Windows.Forms.Application.DoEvents()

    after uiPlayer.controls.play()...doesn't work better Thanks for your help!!

    Visual Basic debugging help question workspace

  • Sound doesn't play instantly...but wait for next operation to complete!!
    J Jayme65

    I've a big interrogation concerning sound playback (WMP.lib)! This code should play a sound, then compute...but it computes then play the sound!

    Class MainWindow
    Dim writingPath As String = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) & "\_UI Sounds\"
    Dim uiPlayer As New WMPLib.WindowsMediaPlayer
    Private Sub MainWindow_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
    RunTest()
    End Sub
    Private Sub RunTest()
    Debug.Print("Started!")
    uiPlayer.URL = writingPath & "son1.wav"
    uiPlayer.controls.play()
    '
    Dim a As Integer = 0
    For i As Integer = 0 To 999999999
    a = i
    Next
    Debug.Print("Done!")
    End Sub
    End Class

    I thought that I perhaps should run the sound in a thread to be sure that it's played by its own!? But this gives the same result

    Imports System.Threading
    Class MainWindow
    Dim writingPath As String = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) & "\_UI Sounds\"
    Dim uiPlayer As New WMPLib.WindowsMediaPlayer
    Dim uiThread As Thread = New Thread(AddressOf PlayFile)
    Private Sub MainWindow_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
    RunTest()
    End Sub
    Private Sub RunTest()
    uiThread = New Thread(AddressOf PlayFile)
    uiThread.Start()
    '
    Debug.Print("Started!")
    Dim a As Integer = 0
    For i As Integer = 0 To 999999999
    a = i
    Next
    Debug.Print("Done!")
    End Sub
    Private Sub PlayFile()
    uiPlayer.URL = writingPath & "son1.wav"
    uiPlayer.controls.play()
    End Sub
    End Class

    How should I please proceed to hear my sound 'instantly'? What's my mistake? Thanks for your help!!

    Visual Basic debugging help question workspace

  • Using Directory.GetFiles() WITH multiple extensions AND sort order
    J Jayme65

    Hi, I have to get a directory file list, filtered on multiple extensions...and sorted! I use this, which is the fastest way I've found to get dir content filtered on multiple extensions:

    Dim ext As String() = {"*.jpg", "*.bmp","*png"}
    Dim files As String() = ext.SelectMany(Function(f) Directory.GetFiles(romPath, f)).ToArray
    Array.Sort(files)

    and then use an array sort. I was wondering (and this is my question ;)) if there would be a way to do the sorting IN the same main line? A kind of:

    Dim files As String() = ext.SelectMany(Function(f) Directory.GetFiles(romPath, f)[B].Order By Name[/B]).ToArray

    and, if yes, if I would gain speed doing this instead of sorting the array at the end (but I would do my test and report..as soon as I get a solution!!)? Thanks for your help!!

    Visual Basic question algorithms data-structures performance help

  • Control storyboard inside custom control...by code
    J Jayme65

    Hello, How do I please control (start, stop, pause, go to specific time) a controltemplate storyboard inside a custom control..by code? The XAML:

            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}" x:Name="CTarrow">
                        <ControlTemplate.Resources>
                            <Storyboard x:Key="Storyboard1" RepeatBehavior="Forever" AutoReverse="True">
                                <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle">
                                    <DiscreteColorKeyFrame KeyTime="0" Value="#FF0080FF"/>
                                    <DiscreteColorKeyFrame KeyTime="0:0:0.5" Value="#FF004D99"/>
                                    <DiscreteColorKeyFrame KeyTime="0:0:0.8" Value="#FF0080FF"/>
                                </ColorAnimationUsingKeyFrames>
                            </Storyboard>
                        </ControlTemplate.Resources>
                        <Grid>
                            <ContentPresenter RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                            <Rectangle x:Name="rectangle" Height="30" Width="50" Fill="Black" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
    

    In these 3 attemps, the debugger complains about not being able to resolve 'rectangle':

    Dim myStoryboard As New Storyboard
    myStoryboard = Arrow.FindResource("Storyboard1")
    myStoryboard.Begin()

    Dim myStoryboard As New Storyboard
    myStoryboard = CType(Me

    WPF question css wpf debugging

  • Loading XAML at runtime
    J Jayme65

    Hi, I'm working on loading xaml code at runtime. Until now, I can do it with XAML files which are set as "Resource"...but I would like to load it from a user's folder (let's say the "Desktop Folder" for example) How should I please proceed? The XAML example file, loaded as resource file in my project (but I would like to use it "independently")

    The Application XAML code

    The Application VB.Net code

    Class MainWindow
    Private Sub MainWindow_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
    Dim GridUri As New Uri("Resources\theme.xaml", UriKind.Relative)
    Dim sri As Windows.Resources.StreamResourceInfo = Application.GetResourceStream(GridUri)
    Dim xrdr As New System.Windows.Markup.XamlReader()
    Dim grd As Grid = CType(xrdr.LoadAsync(sri.Stream), Grid)
    Me.Content = grd
    End Sub
    End Class

    Thank you!

    WPF csharp html css wpf

  • [XML] XML binding
    J Jayme65

    I have an XML file structured this way:

    10
    

    name1
    name1.png
    top1
    top2
    top3

    name2
    name2.png
    top4
      top5
      top6
    

    I get no difficulties binding to tag, as well as tags contained into it. I get no difficulties to bind the tag into a list box.....but I don't know how to bind to tags into . How to populate a listbox with all elements of the currently selected ?

    WPF wpf wcf xml tutorial question

  • Binding to an XML list of attributes
    J Jayme65

    dbaseman, Thanks again for taking time to help me! If you consider my XML file

        Name1
        
        
        
    
    Name2
    

    Using "XPath=//Kind[1]" will return: "a1, b1" What I would like is "a1, a2, a3" being returned!! How should I please proceed to achieve this (returning all "Kind" attributes of the currently selected "System"? Thanks very much,

    WPF wpf xml wcf question

  • Binding to an XML list of attributes
    J Jayme65

    Thank you very much!! For the first time I can see those data displayed!! ;-) Just one think... of importance: ALL the "Kind" attributes are displayed. I've tried a "IsSynchronizedWithCurrentItem="True"" but it doesn't change anything. Any idea on how to fix it, please? The datatemplate for the combobox that displays the system's "Name":

    The datatemplate for the ListBox that display the "Kind" name attributes (related to the selected "System"!!):

    The WPF controls:

    WPF wpf xml wcf question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups