public void SetTexture(ITexture texture) { mPath = texture.GetName(); mTexture.Dispose(); mTexture = texture.Ref(); if (mTexture.Resource.IsValid()) { PreferredSize = mTexture.Resource.GetSize(); } }