I've recently begun work on an audio application using C#.NET. I've begun some basic implementation of the NAudio library which I intend to use throughout the project. While looking at NAudio's documentation on CodePlex I found a link to the WPF Sound Visualization Library, I was attracted by one of its features in particular which I knew I would require in my app.
So I downloaded and added it to my project References.
I've copied how it is referenced within a window's XAML document, like so:
xmlns:svl="clr-namespace:WPFSoundVisualizationLib;assembly=WPFSoundVisualizationLib"
and then tried to add a control within the library using:
<svl:WaveformTimeline x:Name="testWaveformTimeline"/>
The problem is that the designer/XMAL editor claims: "svl:WaveformTimeline" does not exist in namespace "clr-namespace:WPFSoundVisualizationLib;assembly=WPFSoundVisualizationLib".
Now I know that it does exist. I can make reference to the WaveformTimeline object in the class file, and the object shows up in Visual Studio's Object Browser.
I'm not at all sure why this is the case. If anyone knows any possible solutions to this, or things I should check any help would be appreciated.
I had the same issue and I just found the solution:
By right-clicking on the WPFSoundVisualizationLib .dll I had to 'unblock' the file which had been marked as 'unsafe' by windows because the file were coming from a WebSite. Weird but it was obviously the reason I couldn't use the WaveformTimeLine in my project. A bit late but maybe still worths to post it.
More info here: https://msdn.microsoft.com/en-us/library/dd409252(VS.100).aspx
Related
I'm using baseflow's MediaManager plugin:
https://github.com/Baseflow/XamarinMediaManager
I need to have multiple video views. From reading the documentation, I know I need to create a video view using native android views in my xaml like this:
<mediamanager.platforms.android.video.VideoView
android:id="#+id/your_videoview"
android:layout_width="match_parent"
android:layout_height="300dp" />
I used the following documentation to try and add native view support:
https://learn.microsoft.com/en-gb/xamarin/xamarin-forms/platform/native-views/xaml
The problem I'm having is that I can't seem to correctly reference 'android:'. I've added the references and I've set [XamlCompilation(XamlCompilationOptions.Skip)] but still I get the squiggly green lines. I've also cleaned/rebuilt/deleted bin/obj files.
Maybe I'm missing something obvious, maybe there is a code wizard out there that can point me in the right direction.
You don’t need to use any of that! You should try the brand new ‘MediaElement’ control on Xamarin forms. It makes adding videos a piece of cake:
<MediaElement Source="https://sec.ch9.ms/ch9/5d93/a1eab4bf-3288-4faf-81c4-294402a85d93/XamarinShow_mid.mp4"
ShowsPlaybackControls="True" />
Even though it’s in preview, it works really smoothly, I watched it in a Kym Philpotts live demo during MS Build 2020. Check out the official docs for it over here: https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/mediaelement
Here’s a video to the recorded stream too: https://youtube.com/watch?v=dMR6uaFz0Eg
You can use native views in Forms. Unfortunately, this here is not the case. Your native view needs its own *.axml file in the Android project in order for you to use it.
Looking at the rest of the code that you need for this particular configuration, it should also be written natively (in the Android project) - FindViewById && SetView are all code that needs to be in the Android project.
Unfortunately, in some cases not everything has been prepared for usage in the shared project and occasionally you need to get "your hands dirty" and go "native" in order to configure your code the way you wish.
What you should do it use it as it is being shown in Xamarin.Forms section. Then, you can apply the modifications that are documented in Add Video Player to the UI. You can create a class that inherits from VideoViewRenderer and modify your view there. If you are not familiar with customs renderers, you can read more about them here.
I'm maintaining one program written in C# 2.0 (VS2005). It has pretty large codebase, lot of authors, it is almost internal app, but currently it is also one of our customers using it.
App is multilingual and translation of own forms and components works OK. But, there is one component - DockPanel Suite by WeifenLuo and I need to translate it to another language (zh-CN) - one of the chinese guys translated resource file to his language and now I'm trying to include and use in application, but I'm failing in it - although whole app is in chinese, this component remains in english. The untranslated resource file can be found on github: https://github.com/dockpanelsuite/dockpanelsuite/blob/master/WinFormsUI/Docking/Strings.resx
How to do that? I tried almost everything, naive approach (just resgen and compile by al, and trying to use it as satellite assembly - also tried ilmerge), then opening DockPanelSuite in VS2013 Express, adding resx as Strings.zh-CN.resx, but nothing works and tooltips and others are still in english.
Tried also stepping-in with debugger, but debugger broke at tooltip = Strings.DockPaneCaption_ToolTipAutoHide but it didn't step into getter defined in Strings.Designer.cs
I'm stuck and I don't know, how to do that. Any idea? Thanks very much!
I was able to translate a label in the demo application in a very simple process:
git clone the library
Copy & paste the Strings.resx file
Rename the copy into Strings.pt-BR.resx
Compile, it's done (in my case, I translated the "Close" label)
however, this project contains many Strings.resx files
Did you change all of them? Or did you just change one? (maybe a wrong one, like I did in my first try)
I am coding a UserInterface for our ETO Autodesk CAD Software. This is done as a simple add on in C#. Effectively its a class Library DLL placed under a certain path.
Now at the point I need to show images in the user Interface I get this message: The argument docData must implement the interface IVsTextStream.
The code is not saving anymore and eventually the complete windows form is suddenly empty.
I try to use pictureBox or add the image directly on the tab of a tabcontrol. I used different file formats like png or bmp. Always the same Error.
Hope someone can help. Internet does not show anything.
Same Problem occurs to me for a windows application. I have searched for the same issue and find somewhere that "deleting resx file from the form may help you." Well, my issue was resolve after doing so.
Hope it will be helpful for you.
VS2019 (16.9.2) Got the The argument docData must implement the interface IVsTextStream
My case happens when importing new thing to resx. (Inserting an image to the form or control also counted as importing thing to resx) I compared my project the working one and noticed wrong file dependency, I made the following fixes:
Note that this is WinForm for .NET framework, not .NET core. When creating new project in VS there are 2 separated project templates:
"Windows Forms App (.NET Framework)" <- I'm using this one
"Windows Forms App" <- This one will be using newer gen of cross platform .NET family
My fix
I found that my resx was parented in wrong fashion. MainForm.resx should be parented (dependent upon) MainForm.cs
I found that my resx was associated with wrong tool. Correct one for my form's resx is 'blank'. Note that Custom Tool for application global Resources.resx should be PublicResXFileCodeGenerator
For OP's case of blank form after error dialog
I also suffered from this, and I has confirmed that the designer somehow confused and actually REMOVED all of your form contents. This cannot be undone, unless you have version control, sadly.
I browsed through some questions and this one stood out as the better one:
.Net Classes and their source code which pointed me to this place here: Microsoft Reference Source Server.
I tried everything the site says, downloaded a file that I cannot open from there and at some point ended up with a .pdb file in my source folder for the symbol cache that I could not open with a multitude of tools I looked into.
So this is my last resort to find an answer to my question. Out of pure curiosity (and lack of a better way to understand some stuff) I want to open a particular class from Microsoft (namely I wanna look into RichTextBox and maybe the classes it inherits from) but I simply cannot find a way to make this work for me. I want the original source, not a decompiler product because, well because I mainly need to understand some stuff, not see random variable names. I appreciate any help that may get me around my stupidity and clumsiness, as well as the right tools to do so (if any other than VS).
Note that I am using Visual Studio 2012 and yes, I went over a guide covering this specific version instead of the guide on VS 2008.
The "download" links on this page: http://referencesource.microsoft.com/netframework.aspx should work. However try downloading them via Internet Explorer; my Firefox attempted to download an .aspx file instead of the installer itself for some reason. (EDIT: as #ParagMeshram pointed out, just rename the netframework.aspx to netframework.msi as a quick fix if necessary)
In addition, here's a link to the source hosted by dotnetframework.org: http://www.dotnetframework.org/default.aspx/4#0/4#0/untmp/DEVDIV_TFS/Dev10/Releases/RTMRel/wpf/src/Framework/System/Windows/Controls/RichTextBox#cs/1305600/RichTextBox#cs
I can't say for certain if it's the latest greatest, or what you would be compiling against exactly, but should give you a good idea of how it works.
Recently stumbled upon this post whilst trying to decide on the best way of getting a VLC player into C#.
Does VLC media player have a C# interface?
I downloaded the dll files and imported them into my project, but then realised I had no real idea of how to use them. Has anyone got a Windows Forms example of this code that works? The code have tried is shown below -
Vlc.DotNet.Core.Medias.MediaBase media = new
Vlc.DotNet.Core.Medias.PathMedia(#"C:\Users\...\SampleVideos\Wildlife.wmv");
Vlc.DotNet.Forms.VlcControl vlcControl1 = new Vlc.DotNet.Forms.VlcControl();
vlcControl1.Play(media);
I am also using the code in this link in the main program.cs of my project.
http://vlcdotnet.codeplex.com/wikipage?title=Forms
The current problem I experience is that upon starting the project it throws a NullReferenceException when it gets to ->
vlcControl1.Play(media)
The problem seems to be with the vlcControl but I am unsure why. The documentation seems to rather thin and I couldn't find any working examples on the codeplex site. If anyone has a working forms example or knows what I might have missed please let me know!
Here is the call stack present when the error occurs ->
RTSPViewer_Test.exe!RTSPViewer_Test.Form1.Form1_Load(object sender,
System.EventArgs e) Line 31 + 0xd bytes C#
RTSPViewer_Test.exe!RTSPViewer_Test.Program.Main() Line 30 + 0x1d bytes C#
When debugging it appears that the Media and Medias attribute of the VLC control are both null. When trying to set the Media of the control to the media object created above a
NullReferenceException
Checking the VLC control object Media does indeed equal null, but I am not sure why it hasn't been initialised properly.
I was unable to get the program to work using the latest version of the Vlc.dotnet libraries but instead used the alpha 2 version which was posted by Raj. I used VLC version 1.1.5 with this library to get the basic example to function properly. My end objective was to stream from an rtsp device, however this library does not appear to support this functionality yet.
For anyone looking to use a good C# wrapper for using VLC then this is a great example -
http://www.codeproject.com/Articles/109639/nVLC
Used the library files from VLC 1.1.1 with this project and works fine. Supports pretty much all the features that you would usually use in VLC but gives you much more control over what you use them for.
Many of the issues that arise when using these DLL wrappers arose from incorrect versions of the source DLL files. The VLC libraries are only 32 bit at this time, so you need to make sure to compile using x86 mode otherwise the libvlc.dll will not load properly and the application will crash. Using the above example you must also make sure that the libvlc.dll, libvlccore.dll and the plugins folder are included in the build folder.